CN116212370A - Method and device for rendering virtual natural landscape, storage medium and electronic device - Google Patents

Method and device for rendering virtual natural landscape, storage medium and electronic device Download PDF

Info

Publication number
CN116212370A
CN116212370A CN202211709931.XA CN202211709931A CN116212370A CN 116212370 A CN116212370 A CN 116212370A CN 202211709931 A CN202211709931 A CN 202211709931A CN 116212370 A CN116212370 A CN 116212370A
Authority
CN
China
Prior art keywords
virtual
natural landscape
rendering
coverage area
coverage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211709931.XA
Other languages
Chinese (zh)
Inventor
凌帆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202211709931.XA priority Critical patent/CN116212370A/en
Publication of CN116212370A publication Critical patent/CN116212370A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation
    • G06T15/205Image-based rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/80Shading
    • G06T15/83Phong shading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Geometry (AREA)
  • Computer Graphics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computing Systems (AREA)
  • Image Generation (AREA)

Abstract

The application discloses a method and device for rendering virtual natural landscapes, a storage medium and an electronic device. The method comprises the following steps: determining a first coverage range of the virtual natural landscape by adopting a first direction and a second direction, wherein the first direction is a normal direction of a virtual vegetation model in a game scene, and the second direction is a coverage direction of the virtual natural landscape to the virtual vegetation model; determining thickness information of the virtual natural landscape based on the first coverage area and the second direction; performing transition processing on the first mapping and the second mapping through the first coverage area to obtain a processing result, wherein the first mapping is a primary color mapping of the virtual natural landscape, and the second mapping is a normal mapping of the virtual natural landscape; and rendering the virtual natural landscape on the virtual vegetation model by using the thickness information, the first coverage area and the processing result. The virtual natural landscape rendering method solves the technical problems that the virtual natural landscape rendering method provided in the related art is large in performance consumption and poor in rendering flexibility and reusability.

Description

Method and device for rendering virtual natural landscape, storage medium and electronic device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and apparatus for rendering a virtual natural landscape, a storage medium, and an electronic apparatus.
Background
In virtual game scenes, rendering realistic natural landscapes (e.g., frost, snow, etc.) can enhance the realism and expressive power of the scene. However, rendering realistic natural landscapes typically requires a large performance consumption. Particularly, when the virtual natural landscape is rendered on the virtual vegetation surface, the performance of equipment required to be consumed is very high.
In the related art, a background map of a natural landscape to be rendered is generally modified, and a preset landscape map is manually added to an area of the natural landscape to be rendered in the background map, so that a rendering effect of the natural landscape is realized. However, this method has drawbacks in that: the process is complex, the workload is large, the reusability is poor, and the rendering degree and the rendering range of the area to be rendered are difficult to control.
In view of the above problems, no effective solution has been proposed at present.
It should be noted that the information disclosed in the foregoing background section is only for enhancing understanding of the background of the present application and thus may include information that does not form the prior art that is already known to those of ordinary skill in the art.
Disclosure of Invention
At least some embodiments of the present application provide a method, an apparatus, a storage medium, and an electronic device for rendering a virtual natural landscape, so as to at least solve the technical problems of large performance consumption, poor rendering flexibility, and poor reusability of the virtual natural landscape rendering method provided in the related art.
According to one embodiment of the present application, there is provided a method of rendering a virtual natural landscape, including: determining a first coverage range of the virtual natural landscape by adopting a first direction and a second direction, wherein the first direction is a normal direction of a virtual vegetation model in a game scene, and the second direction is a coverage direction of the virtual natural landscape to the virtual vegetation model; determining thickness information of the virtual natural landscape based on the first coverage area and the second direction; performing transition processing on the first mapping and the second mapping through the first coverage area to obtain a processing result, wherein the first mapping is a primary color mapping of the virtual natural landscape, and the second mapping is a normal mapping of the virtual natural landscape; and rendering the virtual natural landscape on the virtual vegetation model by using the thickness information, the first coverage area and the processing result.
According to one embodiment of the present application, there is also provided an apparatus for rendering a virtual natural landscape, including: the first determining module is used for determining a first coverage range of the virtual natural landscape by adopting a first direction and a second direction, wherein the first direction is a normal direction of the virtual vegetation model in the game scene, and the second direction is a coverage direction of the virtual natural landscape to the virtual vegetation model; the second determining module is used for determining thickness information of the virtual natural landscape based on a second direction; the processing module is used for carrying out transition processing on the first mapping and the second mapping through the first coverage area to obtain a processing result, wherein the first mapping is a primary color mapping of the virtual natural landscape, and the second mapping is a normal mapping of the virtual natural landscape; and the rendering module is used for rendering the virtual natural landscape on the virtual vegetation model by utilizing the thickness information, the first coverage area and the processing result.
According to one embodiment of the present application, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the method of rendering a virtual natural landscape in any of the above-mentioned embodiments when run.
According to one embodiment of the present application, there is also provided an electronic device including: comprising a memory in which a computer program is stored and a processor arranged to run the computer program to perform the method of rendering a virtual natural landscape of any of the above.
In at least some embodiments of the present application, a first coverage area of a virtual natural landscape is determined by using a first direction and a second direction, where the first direction is a normal direction of a virtual vegetation model in a game scene, the second direction is a coverage direction of the virtual natural landscape on the virtual vegetation model, thickness information of the virtual natural landscape is determined based on the first coverage area and the second direction, and further, transition processing is performed on the first map and the second map through the first coverage area to obtain a processing result, where the first map is a primary color map of the virtual natural landscape, and the second map is a normal map of the virtual natural landscape, and the virtual natural landscape is rendered on the virtual vegetation model by using the thickness information, the first coverage area and the processing result, so that a purpose of rendering the virtual natural landscape on the virtual vegetation model at a lower cost is achieved, and a technical effect of reducing performance consumption of the virtual natural landscape on the virtual preparation model and improving flexibility and reusability of a rendering process is achieved, and further, a technical problem of a virtual natural landscape rendering method provided in a related technology is solved that performance consumption is large, rendering flexibility and reusability is poor.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a block diagram of a hardware architecture of a mobile terminal of a method of rendering a virtual natural landscape according to one embodiment of the present application;
FIG. 2 is a flow chart of a method of rendering a virtual natural landscape in accordance with one embodiment of the present application;
FIG. 3 is a schematic illustration of an alternative vegetation surface snow coverage according to one embodiment of the present application;
FIG. 4 is a schematic diagram of a primary color map of a snow cover according to one embodiment of the present application;
FIG. 5 is a schematic illustration of a normal map of a snow cover according to one embodiment of the present application;
FIG. 6 is a schematic diagram of a noise map according to one embodiment of the present application;
FIG. 7 is a block diagram of an apparatus for rendering a virtual natural landscape in accordance with one embodiment of the present application;
fig. 8 is a schematic diagram of an electronic device according to one embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the description of the present application, the term "for example" is used to mean "serving as an example, illustration, or description". Any embodiment described herein as "for example" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for purposes of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes have not been shown in detail to avoid obscuring the description of the present application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
Virtual natural landscape (e.g., frost, snow, etc.) effects on the virtual vegetation model surface are an important part of the scene performance in the realistic game. Since the trunk portion (especially the leaf portion) of the virtual vegetation model uses the tab transparency map in large amounts and the pneumatic effect of interaction with the virtual character is often required to be considered, the rendering performance of the virtual vegetation model is generally consumed more. How to render virtual natural landscapes on a virtual vegetation model on the premise of high rendering performance consumption of the virtual vegetation model becomes one of the important problems in the related technical field.
In one possible implementation manner of the application, the inventor still has the technical problems of complex flow, large workload, poor reusability and low flexibility after practice and careful study aiming at a method for modifying a background map of a natural landscape to be rendered, which is generally adopted in the field of computer technology and relates to a virtual natural landscape rendering scene, and based on the technical problems, the scene applied by the embodiment of the application can be a scene related to virtual natural landscape rendering in the field of computer technology, particularly in the field of electronic games, and game types contained in the field of electronic games can be action types, adventure types, simulation types, role playing types, leisure types and the like.
The embodiment of the application provides a virtual natural landscape rendering method, which adopts a primary color mapping and a normal line mapping based on the virtual natural landscape, and utilizes the technical conception of rendering the virtual natural landscape in the normal line direction of a virtual vegetation model and the coverage direction of the virtual natural landscape to the virtual vegetation model in a game scene, thereby realizing the technical effects of reducing the performance consumption of rendering the virtual natural landscape on a virtual preparation model and improving the flexibility and reusability of the rendering process, and further solving the technical problems of large performance consumption, poor rendering flexibility and reusability of the virtual natural landscape rendering method provided in the related technology.
The above-described method embodiments referred to in the present application may be performed in a terminal device (e.g., a mobile terminal, a computer terminal, or similar computing device). Taking the mobile terminal as an example, the mobile terminal can be a smart phone, a tablet computer, a palm computer, a mobile internet device, a PAD, a game machine and other terminal devices.
Fig. 1 is a block diagram of a hardware architecture of a mobile terminal according to a method of rendering a virtual natural landscape according to one embodiment of the present application. As shown in fig. 1, a mobile terminal may include one or more (only one shown in fig. 1) processors 102, memory 104, transmission devices 106, input output devices 108, and display devices 110. Taking the example that the method of rendering the virtual natural landscape is applied to the electronic game scene through the mobile terminal, the processor 102 invokes and runs the computer program stored in the memory 104 to execute the method of rendering the virtual natural landscape, and the virtual natural landscape on the rendered virtual vegetation model is transmitted to the input and output device 108 and/or the display device 110 through the transmission device 106, so that the virtual natural landscape is provided to the player.
As also shown in fig. 1, the processor 102 may include, but is not limited to: a central processor (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), a digital signal processing (Digital Signal Processing, DSP) chip, a microprocessor (Microcontroller Unit, MCU), a programmable logic device (Field Programmable Gate Array, FPGA), a Neural network processor (Neural-Network Processing Unit, NPU), a tensor processor (Tensor Processing Unit, TPU), an artificial intelligence (Artificial Intelligence, AI) type processor, and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
In some optional embodiments based on game scenes, the terminal device may further provide a human-machine interaction interface with a touch-sensitive surface, where the human-machine interaction interface may sense finger contacts and/or gestures to interact with a graphical user interface (Graphical User Interface, GUI), where the human-machine interaction functions may include the following interactions: executable instructions for performing the above-described human-machine interaction functions, such as creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, sending and receiving electronic mail, talking interfaces, playing digital video, playing digital music, and/or web browsing, are configured/stored in a computer program product or readable storage medium executable by one or more processors.
The above method embodiments related to the present application may also be executed in a server. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligent platforms. Taking an example in which the method of rendering the virtual natural landscape is applied to the electronic game scene by the electronic game server, the electronic game server may render the virtual natural landscape on the virtual vegetation model based on the method of rendering the virtual natural landscape and provide the virtual natural landscape to the player (for example, may be rendered and displayed on a display screen of the player terminal, or provided to the player by holographic projection, etc.).
According to one embodiment of the present application, there is provided an embodiment of a method of rendering a virtual natural landscape, it being noted that the steps illustrated in the flowchart of the figures may be performed in a computer system, such as a set of computer executable instructions, and, although a logical order is illustrated in the flowchart, in some cases, the steps illustrated or described may be performed in an order other than that illustrated herein.
In this embodiment, a method for rendering a virtual natural landscape running on the mobile terminal is provided, and fig. 2 is a flowchart of a method for rendering a virtual natural landscape according to one embodiment of the present application, as shown in fig. 2, and the method includes the following steps:
s21, determining a first coverage area of the virtual natural landscape by adopting a first direction and a second direction, wherein the first direction is a normal direction of a virtual vegetation model in a game scene, and the second direction is a coverage direction of the virtual natural landscape to the virtual vegetation model;
the game scene may be a virtual game scene displaying a virtual natural landscape, and the game scene may correspond to the game type: action classes (e.g., first or third person shooter games, two-or three-dimensional combat games, war action games, sports action games, etc.), adventure classes (e.g., adventure games, collection games, puzzle games, etc.), simulation classes (e.g., simulated sand table games, simulated foster games, strategy simulation games, city building simulation games, business simulation games, etc.), role playing classes and leisure classes (e.g., chess and card game games, recreation game games, music rhythm games, trade foster games, etc.), etc.
The game scene also comprises virtual vegetation models such as trees, shrubs, grass clusters, flowers clusters and the like. The normal direction of the virtual vegetation model may be the first direction (may be expressed in a vector form) described above. The virtual natural landscape (e.g., frost, snow, etc.) may be overlaid on the virtual vegetation model. The direction of coverage of the virtual vegetation model by the virtual natural landscape may be the above-described second direction (may be expressed in a vector form).
And determining the first coverage range of the virtual natural landscape by adopting the normal direction of the virtual vegetation model and the coverage direction of the virtual natural landscape to the virtual vegetation model in the game scene. The first coverage area is used for rendering the virtual natural landscape on the virtual vegetation model.
Step S22, determining thickness information of the virtual natural landscape based on the first coverage area and the second direction;
and determining thickness information of the virtual natural landscape based on the first coverage area and the coverage direction of the virtual natural landscape to the virtual vegetation model. For example, the thickness information may be the thickness of a virtual snow model overlaid on the virtual vegetation model.
Step S23, performing transition processing on the first mapping and the second mapping through the first coverage area to obtain a processing result, wherein the first mapping is a primary color mapping of the virtual natural landscape, and the second mapping is a normal mapping of the virtual natural landscape;
The first map is used for determining the rendering color of the virtual natural landscape, and is a primary color map of the virtual natural landscape. The second mapping is used for determining three-dimensional detail textures of the virtual natural landscape, and the second mapping is a normal mapping of the virtual natural landscape.
And performing transition processing on the primary color map and the normal map of the virtual natural landscape through the first coverage area to obtain the processing result. The result of this process may be a new hybrid map.
And step S24, rendering the virtual natural landscape on the virtual vegetation model by using the thickness information, the first coverage area and the processing result.
And rendering the virtual natural landscape on the virtual vegetation model by using the thickness information of the virtual natural landscape, the first coverage of the virtual natural landscape on the virtual vegetation model and the processing result.
It is easy to understand that, according to the method for rendering a virtual natural landscape provided in the above steps S21 to S24 of the present application, the background map of the natural landscape to be rendered does not need to be modified manually, and the virtual natural landscape is rendered by using the normal direction of the virtual vegetation model in the game scene and the coverage direction of the virtual natural landscape to the virtual vegetation model based on the primary color map and the normal map of the virtual natural landscape.
In at least some embodiments of the present application, a first coverage area of a virtual natural landscape is determined by using a first direction and a second direction, where the first direction is a normal direction of a virtual vegetation model in a game scene, the second direction is a coverage direction of the virtual natural landscape on the virtual vegetation model, thickness information of the virtual natural landscape is determined based on the first coverage area and the second direction, and further, transition processing is performed on the first map and the second map through the first coverage area to obtain a processing result, where the first map is a primary color map of the virtual natural landscape, and the second map is a normal map of the virtual natural landscape, and the virtual natural landscape is rendered on the virtual vegetation model by using the thickness information, the first coverage area and the processing result, so that a purpose of rendering the virtual natural landscape on the virtual vegetation model at a lower cost is achieved, and a technical effect of reducing performance consumption of the virtual natural landscape on the virtual preparation model and improving flexibility and reusability of a rendering process is achieved, and further, a technical problem of a virtual natural landscape rendering method provided in a related technology is solved that performance consumption is large, rendering flexibility and reusability is poor.
The above-described methods of embodiments of the present application are further described below.
Optionally, in step S21, determining the first coverage of the virtual natural landscape using the first direction and the second direction may include performing the steps of:
step S211, obtaining an included angle relation between the first direction and the second direction;
step S211, determining the first coverage area based on the angle relation.
The relationship between the first direction and the second direction may include: perpendicular, parallel, and other angular relationships. The specific mode for determining the first coverage area based on the included angle relation is as follows: determining a region with an included angle relation between the normal direction (namely a first direction) of the virtual vegetation model and the covering direction (namely a second direction) of the virtual natural landscape to the virtual vegetation model as a vertical relation as a range which is not required to be covered; determining an area with an included angle relation between the normal direction of the virtual vegetation model and the covering direction of the virtual natural landscape on the virtual vegetation model as a parallel relation as a range to be covered; calculating a range to be covered in an area with an included angle relation between the normal direction of the virtual vegetation model and the covering direction of the virtual natural landscape on the virtual vegetation model as other angle relations by utilizing a pre-designated parameter; and further determining all the coverage areas required to be covered on the surface of the virtual vegetation model as the first coverage area.
The method for rendering the virtual natural landscape can be applied to scenes related to virtual natural landscape rendering in the fields of electronic games, virtual reality and the like. The method is particularly suitable for a scene of rendering a virtual natural landscape (such as a snow accumulating layer) on a virtual vegetation model in an electronic game scene, and the technical scheme provided by the embodiment of the application is further described by taking the scene as an example.
In the video game scene, under the scene of rendering the snow accumulation layer on the virtual vegetation model, firstly, the normal direction (corresponding to the first direction) of the virtual vegetation model and the covering direction (corresponding to the second direction) of the snow accumulation layer on the virtual vegetation model are obtained, and the included angle relation between the normal direction of the virtual vegetation model and the covering direction of the snow accumulation layer on the virtual vegetation model is determined. And determining the first coverage area based on the included angle relation, wherein the first coverage area is a to-be-rendered area of the snow covered on the surface of the virtual vegetation model.
Fig. 3 is a schematic view of an alternative coverage area of snow on a vegetation surface according to an embodiment of the present application, and fig. 3 is a cross-sectional view of a tree model covered with snow layers, and according to a normal direction of the tree model and a coverage direction of the snow layers on the data model, an area corresponding to a black line segment shown in fig. 3 may be determined as a coverage area where snow needs to be covered (corresponding to the first coverage area described above).
Optionally, the virtual vegetation model comprises: a virtual trunk model and a virtual branch model, the first direction comprising: in step S211, obtaining the relationship between the trunk normal direction of the virtual trunk model and the branch normal direction of the virtual branch model may include the following steps:
step S2111, performing point multiplication calculation on the main trunk normal direction and the second direction to obtain a first calculation result;
step S2112, converting the branch normal direction from tangent space to world space to obtain a conversion result;
step S2113, performing dot product calculation on the conversion result and the second direction to obtain a second calculation result;
step S2114, determining an angle relationship based on the first calculation result and the second calculation result.
Still taking the example of rendering a snowlayer on a virtual vegetation model in an electronic game scene, the virtual vegetation model comprises a virtual trunk model and a virtual branch model, and accordingly, the normal direction (corresponding to the first direction) of the virtual vegetation model comprises the trunk normal direction of the virtual trunk model and the branch normal direction of the virtual branch model.
And performing point multiplication calculation on the normal direction (corresponding to the first direction) of the virtual vegetation model and the coverage direction (corresponding to the second direction) of the virtual natural landscape to obtain the included angle relation between the first direction and the second direction.
For example, the virtual tree model includes a trunk model and a branch model (including a leaf model). When the snow layer is rendered on the virtual tree model, the trunk part and the branch part can be respectively calculated and rendered.
Specifically, the branch part of the virtual vegetation model is usually realized through the plug-in board, so when the virtual natural landscape is rendered on the branch part, the normal line of the branch part is required to be converted from the tangent space to the world space, and then the normal line of the branch part and the virtual natural landscape are subjected to dot multiplication calculation on the covering direction of the branch part, so that the second calculation result is obtained. The trunk part of the virtual vegetation model usually does not need to undergo space conversion of the normal line, and the normal line of the branch part and the virtual natural landscape directly carry out dot product calculation on the coverage direction of the trunk part to obtain the first calculation result.
And determining the relation of the included angle between the normal direction of the virtual vegetation model and the coverage direction of the virtual natural landscape to the virtual vegetation model through the first calculation result and the second calculation result.
According to the relation of the included angles between the first direction and the second direction, for a certain point on the surface of the virtual vegetation model: when the first direction is perpendicular to the second direction, the point is not covered with the snow accumulating layer at all; when the first direction is parallel to the second direction, the point completely covers the snow accumulation layer; when the first direction and the second direction are in other angle relations, the snow covering degree of the point is determined according to the point multiplication result of the first direction and the second direction.
Alternatively, in step S22, determining thickness information of the virtual natural landscape based on the first coverage and the second direction may include performing the steps of:
step S221, performing offset processing on the model vertexes of the virtual vegetation model based on the first coverage area and the second direction to obtain offset distances of the model vertexes;
in step S222, thickness information is determined using the offset distance.
The thickness information can be used for determining the offset degree of the model vertex of the virtual vegetation model, and the thickness value corresponding to the thickness information is larger as the offset degree is higher.
Still taking the example of rendering a snowlayer on a virtual vegetation model in an electronic game scene, the coverage (corresponding to the first coverage) and the coverage direction (corresponding to the second direction) of the virtual vegetation model by utilizing the virtual natural landscape are utilized to offset the model vertexes of the virtual vegetation model, so as to obtain the offset distance of the model vertexes. The offset distance is further used to determine the thickness of the snowy layer.
It should be noted that, a specific implementation manner of performing offset processing on the model vertices of the virtual vegetation model may be: and shifting the model vertexes of the virtual vegetation model to a new set of positions, or generating a new set of model vertexes based on the model vertexes of the virtual vegetation model and the second direction.
It is easy to understand that the thickness of the snow cover layer is obtained by performing offset processing on the model fixed points of the virtual vegetation model, so that the snow cover layer obtained by rendering can be ensured to have a better virtual vegetation coverage effect (for example, the surface shape of the snow cover layer corresponds to the surface shape of the virtual vegetation model covered by the snow cover layer).
Optionally, in step S23, the transition processing is performed on the first map and the second map through the first coverage area, and determining the processing result may include the following execution steps:
in step S231, a third mapping is used to perform transition processing on the first mapping and the second mapping in the boundary area between the virtual natural landscape and the virtual vegetation model through the first coverage area, and a processing result is determined, where the third mapping is a preset noise mapping.
Still taking the example of rendering a snow accumulation layer on a virtual vegetation model in an electronic game scene, sampling a primary color map and a normal map of a virtual natural landscape based on the coverage (equivalent to the first coverage) of the virtual vegetation model by the snow accumulation layer, and performing transition processing on a boundary area between the primary color map and the normal map by using a preset noise map to obtain a processing result.
Fig. 4 is a schematic diagram of a primary color map of a snow cover according to one embodiment of the present application, fig. 5 is a schematic diagram of a normal line map of a snow cover according to one embodiment of the present application, and fig. 6 is a schematic diagram of a noise map according to one embodiment of the present application. Based on the area (corresponding to the first coverage area) where the surface of the virtual vegetation model needs to be covered with snow, the noise map shown in fig. 6 is used to perform transition processing on the primary color map shown in fig. 4 and the normal line map shown in fig. 5, and the processing result is determined. The processing result is used for determining that the junction between the area needing to be covered with the snow layer and the area not needing to be covered with the snow layer on the surface of the virtual vegetation model has a gradual change effect of noise patterns.
Therefore, in the area with a far angle from the coverage direction (namely the second direction) on the surface of the virtual vegetation model, the influence of the noise mapping is larger, so that the junction between the area needing to be covered with the snow layer and the area not needing to be covered with the snow layer on the surface of the virtual vegetation model has a gradual change effect of noise patterns, and the reality of the virtual natural landscape in the virtual scene is further improved.
Optionally, in step S24, rendering the virtual natural landscape on the virtual vegetation model using the thickness information, the first coverage, and the processing result may include performing the steps of:
step S241, mixing the first coverage area and the processing result to obtain a second coverage area;
step S242, rendering the virtual natural landscape on the virtual vegetation model based on the thickness information and the second coverage.
Still taking the example of rendering a snow accumulation layer on a virtual vegetation model in an electronic game scene, mixing the processing result onto the surface of the virtual vegetation model within the coverage range of the snow accumulation layer to the virtual vegetation model to obtain the second coverage range. The above mixing process may utilize specified parameters to control the coverage (i.e., mixing range) and mixing intensity. And further rendering the snow layer on the virtual vegetation model based on the second coverage area and the thickness of the snow layer.
Specifically, the range of the snow layer to be covered on the virtual vegetation model is still utilized, the noise map as shown in fig. 6 is used as a weight, and the primary color map and the normal line map after the transition processing are subjected to linear interpolation, so that the second coverage range is obtained. The above linear interpolation can be expressed as Lerp (original color of the virtual vegetation model, snow color, noise figure).
It should be noted that, in the process of mixing the first coverage area and the processing result, parameters may be used to control the range of the snow layer to be covered on the virtual vegetation model. For example, the dot product results in the first direction and the second direction are controlled by interpolation results Lerp (full coverage area, full no coverage area, dot product result); control by a function Step (dot product, x), "when the dot product is not greater than x, the dot product is set to 0 (corresponding to no coverage at all)"; the curve of the dot product function is controlled by the parameter y (for example, the slope of the function is changed by the dot product multiplied by y, and the snow layer is controlled to be faster or slower according to the change degree of the included angle between the first direction and the second direction by setting the value of y).
Optionally, in step S242, rendering the virtual natural landscape on the virtual vegetation model based on the thickness information and the second coverage may include performing the steps of:
step S2421, determining a third coverage area by utilizing the second coverage area and the partial area to be removed, wherein the partial area to be removed is an area which is not covered by the virtual natural landscape in the virtual vegetation model;
step S2422, rendering the virtual natural landscape on the virtual vegetation model based on the thickness information and the third coverage.
After the foregoing processing in the foregoing steps of this embodiment, the second coverage area may still include an area (corresponding to the to-be-removed partial area) that is not covered by the virtual natural landscape in the virtual vegetation model, and the second coverage area and the to-be-removed partial area are used to determine a third coverage area. And rendering the snow layer on the virtual vegetation model based on the thickness of the snow layer and the third coverage area.
Optionally, in step S2421, determining the third coverage using the second coverage and the partial region to be culled may include performing the steps of:
step S2423, determining a partial region to be removed from the second coverage area by adopting a global mask drawing mode;
step S2424, the partial region to be removed is removed from the second coverage area, so as to obtain a third coverage area.
The global mask drawing method may be that a second coverage area is identified and drawn by a pre-set Shader (loader) code, and an area (corresponding to the partial area to be removed) that is not covered by the virtual natural landscape in the virtual vegetation model is determined from the second coverage area. And removing the partial area to be removed from the second coverage area to obtain a third coverage area, wherein the third coverage area is the range to be used for rendering the virtual landscape model on the virtual vegetation model. Therefore, the area, which needs to be covered by the snow layer, of the surface of the virtual vegetation model can be further accurately determined, and the rendering fidelity of the virtual natural landscape on the virtual vegetation model is improved.
Illustratively, the region that needs to be determined as the partial region to be culled by the above-described global mask drawing method is as follows: areas where the trunk portion of the vegetation is normal upward, areas in the trunk portion that are obscured by its leaves, and the like.
Through the method provided by the embodiment of the application, a general method for rendering the virtual natural landscape on the virtual vegetation model can be realized by using a Shader (such as a loader) code, and the virtual natural landscape rendering effect (such as coverage degree, coverage range and coverage direction of the virtual natural landscape on the virtual vegetation model, primary color mapping, normal mapping and the like of the virtual natural landscape) on the virtual vegetation model can be dynamically controlled by parameters, and the parameters can be coupled with other systems (such as a weather system, a time system and the like) in a game engine, so that the reusability and the flexibility are high.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. a magnetic disc, an optical disc), including several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
The embodiment also provides a device for rendering the virtual natural landscape, which is used for implementing the above embodiment and the preferred implementation, and the description is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 7 is a block diagram of an apparatus for rendering a virtual natural landscape according to one embodiment of the present application, as shown in fig. 7, the apparatus includes: a first determining module 71, configured to determine a first coverage area of the virtual natural landscape by using a first direction and a second direction, where the first direction is a normal direction of the virtual vegetation model in the game scene, and the second direction is a coverage direction of the virtual natural landscape to the virtual vegetation model; a second determining module 72 for determining thickness information of the virtual natural landscape based on the second direction; the processing module 73 is configured to perform transition processing on a first map and a second map through a first coverage area to obtain a processing result, where the first map is a primary color map of the virtual natural landscape, and the second map is a normal line map of the virtual natural landscape; and a rendering module 74 for rendering the virtual natural landscape on the virtual vegetation model by using the thickness information, the first coverage and the processing result.
Optionally, the first determining module 71 is further configured to: acquiring an included angle relation between a first direction and a second direction; the first coverage area is determined based on the angular relationship.
Optionally, the virtual vegetation model comprises: a virtual trunk model and a virtual branch model, the first direction comprising: the first determining module 71 is further configured to: performing point multiplication calculation on the main trunk normal direction and the second direction to obtain a first calculation result; converting the branch normal direction from tangent space to world space to obtain a conversion result; performing point multiplication calculation on the conversion result and the second direction to obtain a second calculation result; and determining an included angle relation based on the first calculation result and the second calculation result.
Optionally, the second determining module 72 is further configured to: performing offset processing on model vertexes of the virtual vegetation model based on the first coverage area and the second direction to obtain offset distances of the model vertexes; thickness information is determined using the offset distance.
Optionally, the processing module 73 is further configured to: and performing transition processing on the first mapping and the second mapping by using a third mapping in the junction area of the virtual natural landscape and the virtual vegetation model through the first coverage area, and determining a processing result, wherein the third mapping is a preset noise mapping.
Optionally, the rendering module 74 is further configured to: mixing the first coverage area with the processing result to obtain a second coverage area; and rendering a virtual natural landscape on the virtual vegetation model based on the thickness information and the second coverage.
Optionally, the rendering module 74 is further configured to: determining a third coverage area by using the second coverage area and the partial area to be removed, wherein the partial area to be removed is an area which is not covered by the virtual natural landscape in the virtual vegetation model; and rendering a virtual natural landscape on the virtual vegetation model based on the thickness information and the third coverage.
Optionally, the rendering module 74 is further configured to: determining a partial region to be removed from the second coverage area by adopting a global mask drawing mode; and removing the partial area to be removed from the second coverage area to obtain a third coverage area.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described computer-readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media in which a computer program can be stored.
Alternatively, in this embodiment, the above-mentioned computer-readable storage medium may be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.
Alternatively, in the present embodiment, the above-described computer-readable storage medium may be configured to store a computer program for performing the steps of:
s1, determining a first coverage area of a virtual natural landscape by adopting a first direction and a second direction, wherein the first direction is a normal direction of a virtual vegetation model in a game scene, and the second direction is a coverage direction of the virtual natural landscape to the virtual vegetation model;
s2, determining thickness information of the virtual natural landscape based on the first coverage area and the second direction;
s3, performing transition processing on the first mapping and the second mapping through the first coverage area to obtain a processing result, wherein the first mapping is a primary color mapping of the virtual natural landscape, and the second mapping is a normal mapping of the virtual natural landscape;
And S4, rendering the virtual natural landscape on the virtual vegetation model by using the thickness information, the first coverage area and the processing result.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: acquiring an included angle relation between a first direction and a second direction; the first coverage area is determined based on the angular relationship.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: performing point multiplication calculation on the main trunk normal direction and the second direction to obtain a first calculation result; converting the branch normal direction from tangent space to world space to obtain a conversion result; performing point multiplication calculation on the conversion result and the second direction to obtain a second calculation result; and determining an included angle relation based on the first calculation result and the second calculation result.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: performing offset processing on model vertexes of the virtual vegetation model based on the first coverage area and the second direction to obtain offset distances of the model vertexes; thickness information is determined using the offset distance.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: and performing transition processing on the first mapping and the second mapping by using a third mapping in the junction area of the virtual natural landscape and the virtual vegetation model through the first coverage area, and determining a processing result, wherein the third mapping is a preset noise mapping.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: mixing the first coverage area with the processing result to obtain a second coverage area; and rendering a virtual natural landscape on the virtual vegetation model based on the thickness information and the second coverage.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: determining a third coverage area by using the second coverage area and the partial area to be removed, wherein the partial area to be removed is an area which is not covered by the virtual natural landscape in the virtual vegetation model; and rendering a virtual natural landscape on the virtual vegetation model based on the thickness information and the third coverage.
Optionally, the above computer readable storage medium is further configured to store program code for performing the steps of: determining a partial region to be removed from the second coverage area by adopting a global mask drawing mode; and removing the partial area to be removed from the second coverage area to obtain a third coverage area.
In the computer-readable storage medium of the above embodiment, a technical solution for implementing a method for rendering a virtual natural landscape is provided. The method comprises the steps of determining a first coverage area of a virtual natural landscape by adopting a first direction and a second direction, wherein the first direction is a normal direction of a virtual vegetation model in a game scene, the second direction is a coverage direction of the virtual natural landscape to the virtual vegetation model, thickness information of the virtual natural landscape is determined based on the first coverage area and the second direction, and further, transition processing is carried out on a first mapping and a second mapping through the first coverage area to obtain a processing result, wherein the first mapping is a primary color mapping of the virtual natural landscape, the second mapping is a normal mapping of the virtual natural landscape, the virtual natural landscape is rendered on the virtual vegetation model by utilizing the thickness information, the first coverage area and the processing result, and the purpose of rendering the virtual natural landscape on the virtual vegetation model at lower cost is achieved, so that the technical effects of reducing the performance consumption of the virtual natural landscape on a virtual preparation model and improving the flexibility and the reusability of a rendering process are achieved, and the technical problems of the virtual natural landscape rendering method provided in the related technology that the performance consumption is large, the flexibility and the reusability are solved.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a computer readable storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present application.
In an exemplary embodiment of the present application, a computer-readable storage medium stores thereon a program product capable of implementing the method described above in the present embodiment. In some possible implementations, the various aspects of the embodiments of the present application may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps according to the various exemplary embodiments of the present application as described in the "exemplary methods" section of the embodiments, when the program product is run on the terminal device.
A program product for implementing the above method according to an embodiment of the present application may employ a portable compact disc read-only memory (CD-ROM) and comprise program code and may be run on a terminal device, such as a personal computer. However, the program product of the embodiments of the present application is not limited thereto, and in the embodiments of the present application, the computer-readable storage medium may be any tangible medium that can contain, or store the program for use by or in connection with the instruction execution system, apparatus, or device.
Any combination of one or more computer readable media may be employed by the program product described above. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It should be noted that the program code embodied on the computer readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Embodiments of the present application also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, determining a first coverage area of a virtual natural landscape by adopting a first direction and a second direction, wherein the first direction is a normal direction of a virtual vegetation model in a game scene, and the second direction is a coverage direction of the virtual natural landscape to the virtual vegetation model;
s2, determining thickness information of the virtual natural landscape based on the first coverage area and the second direction;
S3, performing transition processing on the first mapping and the second mapping through the first coverage area to obtain a processing result, wherein the first mapping is a primary color mapping of the virtual natural landscape, and the second mapping is a normal mapping of the virtual natural landscape;
and S4, rendering the virtual natural landscape on the virtual vegetation model by using the thickness information, the first coverage area and the processing result.
Optionally, the above processor may be further configured to perform the following steps by a computer program: acquiring an included angle relation between a first direction and a second direction; the first coverage area is determined based on the angular relationship.
Optionally, the above processor may be further configured to perform the following steps by a computer program: performing point multiplication calculation on the main trunk normal direction and the second direction to obtain a first calculation result; converting the branch normal direction from tangent space to world space to obtain a conversion result; performing point multiplication calculation on the conversion result and the second direction to obtain a second calculation result; and determining an included angle relation based on the first calculation result and the second calculation result.
Optionally, the above processor may be further configured to perform the following steps by a computer program: performing offset processing on model vertexes of the virtual vegetation model based on the first coverage area and the second direction to obtain offset distances of the model vertexes; thickness information is determined using the offset distance.
Optionally, the above processor may be further configured to perform the following steps by a computer program: and performing transition processing on the first mapping and the second mapping by using a third mapping in the junction area of the virtual natural landscape and the virtual vegetation model through the first coverage area, and determining a processing result, wherein the third mapping is a preset noise mapping.
Optionally, the above processor may be further configured to perform the following steps by a computer program: mixing the first coverage area with the processing result to obtain a second coverage area; and rendering a virtual natural landscape on the virtual vegetation model based on the thickness information and the second coverage.
Optionally, the above processor may be further configured to perform the following steps by a computer program: determining a third coverage area by using the second coverage area and the partial area to be removed, wherein the partial area to be removed is an area which is not covered by the virtual natural landscape in the virtual vegetation model; and rendering a virtual natural landscape on the virtual vegetation model based on the thickness information and the third coverage.
Optionally, the above processor may be further configured to perform the following steps by a computer program: determining a partial region to be removed from the second coverage area by adopting a global mask drawing mode; and removing the partial area to be removed from the second coverage area to obtain a third coverage area.
In the electronic device of the above embodiment, a technical solution for implementing a method for rendering a virtual natural landscape is provided. The method comprises the steps of determining a first coverage area of a virtual natural landscape by adopting a first direction and a second direction, wherein the first direction is a normal direction of a virtual vegetation model in a game scene, the second direction is a coverage direction of the virtual natural landscape to the virtual vegetation model, thickness information of the virtual natural landscape is determined based on the first coverage area and the second direction, and further, transition processing is carried out on a first mapping and a second mapping through the first coverage area to obtain a processing result, wherein the first mapping is a primary color mapping of the virtual natural landscape, the second mapping is a normal mapping of the virtual natural landscape, the virtual natural landscape is rendered on the virtual vegetation model by utilizing the thickness information, the first coverage area and the processing result, and the purpose of rendering the virtual natural landscape on the virtual vegetation model at lower cost is achieved, so that the technical effects of reducing the performance consumption of the virtual natural landscape on a virtual preparation model and improving the flexibility and the reusability of a rendering process are achieved, and the technical problems of the virtual natural landscape rendering method provided in the related technology that the performance consumption is large, the flexibility and the reusability are solved.
Fig. 8 is a schematic diagram of an electronic device according to one embodiment of the present application. As shown in fig. 8, the electronic device 800 is merely an example, and should not impose any limitation on the functionality and scope of use of the embodiments of the present application.
As shown in fig. 8, the electronic apparatus 800 is embodied in the form of a general purpose computing device. Components of the electronic device 800 may include, but are not limited to: the at least one processor 810, the at least one memory 820, a bus 830 connecting the various system components including the memory 820 and the processor 810, and a display 840.
Wherein the memory 820 stores program code that can be executed by the processor 810, such that the processor 810 performs the steps according to various exemplary implementations of the present application described in the above method section of the embodiments of the present application.
The memory 820 may include readable media in the form of volatile memory units, such as Random Access Memory (RAM) 8201 and/or cache memory 8202, and may further include Read Only Memory (ROM) 8203, and may also include nonvolatile memory, such as one or more magnetic storage devices, flash memory, or other nonvolatile solid state memory.
In some examples, memory 820 may also include a program/utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. The memory 820 may further include memory remotely located relative to the processor 810, which may be connected to the electronic device 800 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Bus 830 may be one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, processor 810, or a local bus using any of a variety of bus architectures.
The display 840 may be, for example, a touch screen type liquid crystal display (Liquid Crystal Display, LCD) that may enable a user to interact with a user interface of the electronic device 800.
Optionally, the electronic apparatus 800 may also communicate with one or more external devices 900 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic apparatus 800, and/or with any device (e.g., router, modem, etc.) that enables the electronic apparatus 800 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 850. Also, the electronic device 800 may communicate with one or more networks (e.g., local area network (Local Area Network, LAN), wide area network (Wide Area Network, WAN) and/or public network, such as the internet) via the network adapter 860. As shown in fig. 8, network adapter 860 communicates with other modules of electronic device 800 over bus 830. It should be appreciated that although not shown in fig. 8, other hardware and/or software modules may be used in connection with the electronic device 800, which may include, but are not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk array (Redundant Arrays of Independent Disks, RAID) systems, tape drives, data backup storage systems, and the like.
The electronic device 800 may further include: a keyboard, a cursor control device (e.g., a mouse), an input/output interface (I/O interface), a network interface, a power supply, and/or a camera.
It will be appreciated by those of ordinary skill in the art that the configuration shown in fig. 8 is merely illustrative and is not intended to limit the configuration of the electronic device described above. For example, the electronic device 800 may also include more or fewer components than shown in fig. 8, or have a different configuration than shown in fig. 8. The memory 820 may be used to store computer programs and corresponding data, such as corresponding computer programs and corresponding data for the method of rendering a virtual natural landscape in embodiments of the present application. The processor 810 performs various functional applications and data processing by running a computer program stored in the memory 820, i.e., implements the method of rendering a virtual natural landscape described above.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology content may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a read-only memory (ROM), a random-access memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, etc., which can store program codes.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (11)

1. A method of rendering a virtual natural landscape, comprising:
determining a first coverage range of a virtual natural landscape by adopting a first direction and a second direction, wherein the first direction is a normal direction of a virtual vegetation model in a game scene, and the second direction is a coverage direction of the virtual natural landscape to the virtual vegetation model;
determining thickness information of the virtual natural landscape based on the first coverage area and the second direction;
performing transition processing on a first mapping and a second mapping through the first coverage area to obtain a processing result, wherein the first mapping is a primary color mapping of the virtual natural landscape, and the second mapping is a normal mapping of the virtual natural landscape;
and rendering the virtual natural landscape on the virtual vegetation model by using the thickness information, the first coverage and the processing result.
2. The method of claim 1, wherein determining the first coverage of the virtual natural landscape using the first direction and the second direction comprises:
acquiring an included angle relation between the first direction and the second direction;
and determining the first coverage area based on the included angle relation.
3. The method of claim 2, wherein the virtual vegetation model comprises: a virtual backbone model and a virtual branch model, the first direction comprising: the obtaining the relation of the included angle between the first direction and the second direction includes:
performing point multiplication calculation on the main trunk normal direction and the second direction to obtain a first calculation result;
converting the branch normal direction from tangent space to world space to obtain a conversion result;
performing dot product calculation on the conversion result and the second direction to obtain a second calculation result;
and determining the included angle relation based on the first calculation result and the second calculation result.
4. The method of claim 1, wherein determining the thickness information of the virtual natural landscape based on the first coverage area and the second direction comprises:
Performing offset processing on model vertexes of the virtual vegetation model based on the first coverage area and the second direction to obtain offset distances of the model vertexes;
and determining the thickness information by using the offset distance.
5. The method of claim 1, wherein performing transition processing on the first map and the second map through the first coverage area, determining the processing result comprises:
and performing transition processing on the first map and the second map by using a third map in the junction area of the virtual natural landscape and the virtual vegetation model through the first coverage area, and determining the processing result, wherein the third map is a preset noise map.
6. The method of claim 1, wherein rendering the virtual natural landscape on the virtual vegetation model using the thickness information, the first coverage, and the processing results comprises:
mixing the first coverage area and the processing result to obtain a second coverage area;
rendering the virtual natural landscape on the virtual vegetation model based on the thickness information and the second coverage.
7. The method of claim 6, wherein rendering the virtual natural landscape on the virtual vegetation model based on the thickness information and the second coverage comprises:
determining a third coverage area by using the second coverage area and the partial area to be removed, wherein the partial area to be removed is an area which is not covered by the virtual natural landscape in the virtual vegetation model;
rendering the virtual natural landscape on the virtual vegetation model based on the thickness information and the third coverage.
8. The method of claim 7, wherein determining the third coverage area using the second coverage area and the partial area to be culled comprises:
determining the partial region to be removed from the second coverage area by adopting a global mask drawing mode;
and rejecting the partial area to be rejected from the second coverage area to obtain the third coverage area.
9. An apparatus for rendering a virtual natural landscape, comprising:
the first determining module is used for determining a first coverage range of the virtual natural landscape by adopting a first direction and a second direction, wherein the first direction is a normal direction of a virtual vegetation model in a game scene, and the second direction is a coverage direction of the virtual natural landscape to the virtual vegetation model;
A second determining module, configured to determine thickness information of the virtual natural landscape based on the second direction;
the processing module is used for performing transition processing on a first mapping and a second mapping through the first coverage area to obtain a processing result, wherein the first mapping is a primary color mapping of the virtual natural landscape, and the second mapping is a normal mapping of the virtual natural landscape;
and the rendering module is used for rendering the virtual natural landscape on the virtual vegetation model by utilizing the thickness information, the first coverage area and the processing result.
10. A computer readable storage medium, characterized in that a computer program is stored in the computer readable storage medium, wherein the computer program is arranged to, when run by a processor, perform the method of rendering a virtual natural landscape as claimed in any of claims 1 to 8.
11. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of rendering a virtual natural landscape as claimed in any of claims 1 to 8.
CN202211709931.XA 2022-12-29 2022-12-29 Method and device for rendering virtual natural landscape, storage medium and electronic device Pending CN116212370A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211709931.XA CN116212370A (en) 2022-12-29 2022-12-29 Method and device for rendering virtual natural landscape, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211709931.XA CN116212370A (en) 2022-12-29 2022-12-29 Method and device for rendering virtual natural landscape, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN116212370A true CN116212370A (en) 2023-06-06

Family

ID=86586394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211709931.XA Pending CN116212370A (en) 2022-12-29 2022-12-29 Method and device for rendering virtual natural landscape, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN116212370A (en)

Similar Documents

Publication Publication Date Title
CN107886562A (en) Water surface rendering intent, device and readable storage medium storing program for executing
US9262853B2 (en) Virtual scene generation based on imagery
CN111145326A (en) Processing method of three-dimensional virtual cloud model, storage medium, processor and electronic device
CN105913471B (en) The method and apparatus of picture processing
CN115375822A (en) Cloud model rendering method and device, storage medium and electronic device
CN115082607A (en) Virtual character hair rendering method and device, electronic equipment and storage medium
WO2024021955A9 (en) Three-dimensional guidance map generation method and device, storage medium, and electronic device
CN116212370A (en) Method and device for rendering virtual natural landscape, storage medium and electronic device
CN116402931A (en) Volume rendering method, apparatus, computer device, and computer-readable storage medium
CN115713589A (en) Image generation method and device for virtual building group, storage medium and electronic device
CN115131489A (en) Cloud layer rendering method and device, storage medium and electronic device
CN115439594A (en) Filter effect rendering method and device of virtual model and storage medium
CN114949863A (en) Virtual character eye rendering method and device, electronic equipment and storage medium
CN116889723A (en) Picture generation method and device of virtual scene, storage medium and electronic device
CN101606180A (en) Video generation device, image generating method, information recording carrier and program
CN115999155A (en) Buoyancy expression method, device and storage medium of virtual floating object model
CN116310014A (en) Subsurface scattering generation method and device, storage medium and electronic device
CN113599818B (en) Vegetation rendering method and device, electronic equipment and readable storage medium
US20240075388A1 (en) Method, apparatus, electronic device and storage media for skill control of virtual object
CN117036573A (en) Method and device for rendering virtual model, storage medium and electronic equipment
CN116570915A (en) Method and device for generating terrain mesh, storage medium and electronic device
CN116452704A (en) Method and device for generating lens halation special effect, storage medium and electronic device
CN117482501A (en) Method and device for generating scene resource model, storage medium and electronic device
Yazdani et al. Adoption of VR influencing AI on 3D objects
CN115797524A (en) Virtual splash animation generation method and device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination