CN109903385A - Rendering method, device, processor and the terminal of threedimensional model - Google Patents
Rendering method, device, processor and the terminal of threedimensional model Download PDFInfo
- Publication number
- CN109903385A CN109903385A CN201910353674.2A CN201910353674A CN109903385A CN 109903385 A CN109903385 A CN 109903385A CN 201910353674 A CN201910353674 A CN 201910353674A CN 109903385 A CN109903385 A CN 109903385A
- Authority
- CN
- China
- Prior art keywords
- baking
- threedimensional model
- vertex
- lighting information
- light
- 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
Links
Abstract
The invention discloses a kind of rendering method of threedimensional model, device, processor and terminals.Wherein, this method comprises: carrying out baking processing to scene of game, light-maps are obtained;The vertex position of threedimensional model carries out resampling to light-maps in scene of game, obtains the baking Lighting information of vertex position, and store Lighting information is baked into the vertex color of threedimensional model, wherein threedimensional model includes multiple tri patch;Threedimensional model is rendered according to the baking Lighting information stored in the color of vertex.The present invention solves the provided rendering mode based on light-maps in the related technology and easily occupies a large amount of memory space, it is difficult to the technical issues of being suitable for complicated scene of game.
Description
Technical field
The present invention relates to computer fields, in particular to a kind of rendering method of threedimensional model, device, processor
And terminal.
Background technique
Currently, when making the higher City scenarios of complexity in game, in order to balance the system performance of mobile terminal and
Rendering effect of the City scenarios in interface, provided rendering mode is normally based on light-maps in the related technology
It realizes.However, the storage that the light-maps to use needed for the higher City scenarios of implementation complexity can occupy GB rank is empty
Between, it is thus very big to the storage resource consumption of mobile terminal.
In order to bake light-maps, can be distributed according to model area and baking resolution ratio set by user for each model
Specific texture space (i.e. the space UV).Multiple sampled points can be arranged in each model surface, and then baking system can call the overall situation
Illumination algorithm calculates the irradiation level information of each sampled point, and after calculating completion, irradiation level information is stored to illumination and is pasted
In figure, to complete the rendering to model by sampling light-maps in game running.
However, there are technological deficiencies as is evident below for above-mentioned rendering mode:
In baking process, each model in respectively City scenarios is needed to distribute the space UV.If scene complexity
It is higher, then it will lead to light-maps and occupy excessive memory space.
In addition, more stringent requirements are proposed to game quality by game player with the hardware advances of mobile terminal, such as:
Day-night shift system.Day-night shift system can enhance the feeling of immersion of game, but its problem is: if using above-mentioned rendering side
Formula then needs to bake a set of light-maps respectively in baking process for day and night, thus leads to the occupancy of memory space
Amount will double to increase, to be easy the scope of application of limitation Day-night shift system, reduce the game experiencing of user.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
The present invention at least partly embodiment provides rendering method, device, processor and the terminal of a kind of threedimensional model, with
It at least solves the provided rendering mode based on light-maps in the related technology and easily occupies a large amount of memory space, it is difficult to be applicable in
In the complicated scene of game the technical issues of.
A wherein embodiment according to the present invention, provides a kind of rendering method of threedimensional model, comprising:
Baking processing is carried out to scene of game, obtains light-maps;The vertex position pair of threedimensional model in scene of game
Light-maps carry out resampling, obtain the baking Lighting information of vertex position, and store Lighting information is baked to three-dimensional mould
In the vertex color of type, wherein threedimensional model includes multiple tri patch;According to the baking Lighting information stored in the color of vertex to three
Dimension module is rendered.
Optionally, resampling is carried out to light-maps in vertex position, obtains baking Lighting information including: using default
Sampling algorithm carries out resampling to light-maps in vertex position, obtains baking Lighting information, wherein default sampling algorithm packet
Include following one: minimum distance sampling algorithm, line sampling algorithm, Gauss sampling algorithm.
Optionally, resampling is carried out to light-maps in vertex position using minimum distance sampling algorithm, is baked
Lighting information.
Optionally, while will bake Lighting information and store to the vertex color of threedimensional model, further includes: delete illumination patch
Figure.
Optionally, rendering is carried out to threedimensional model according to the baking Lighting information stored in the color of vertex and comprises determining that step,
Determine current tri patch to be rendered in threedimensional model;Obtaining step, from the vertex color of current tri patch to be rendered
Obtain the baking Lighting information of each vertex pixel;Processing step, using baking Lighting information to current triangular facet to be rendered
The interior pixels of piece carry out interpolation processing, obtain the baking Lighting information of interior pixels;Rendering step, using each vertex pixel
Baking Lighting information and the baking Lighting informations of interior pixels current tri patch to be rendered is rendered;Judgement step
Suddenly, judge with the presence or absence of the tri patch not yet rendered in threedimensional model, step is determined if it is, returning, if it is not, then wash with watercolours
Dye terminates.
Optionally, the above method further include: divided in the vertex color of threedimensional model using mutually independent memory space
Not Cun Chu adjacent triangular faces public vertex position baking Lighting information.
A wherein embodiment according to the present invention, additionally provides a kind of rendering device of threedimensional model, comprising:
It bakes module and obtains light-maps for carrying out baking processing to scene of game;Sampling module, in game
The vertex position of threedimensional model carries out resampling to light-maps in scene, obtains the baking Lighting information of vertex position, and
Lighting information will be baked to store into the vertex color of threedimensional model, wherein threedimensional model includes multiple tri patch;Handle mould
Block, for being rendered according to the baking Lighting information stored in the color of vertex to threedimensional model.
Optionally, sampling module, for carrying out resampling to light-maps in vertex position using default sampling algorithm,
It obtaining baking Lighting information, wherein default sampling algorithm includes following one: minimum distance sampling algorithm, line sampling algorithm,
Gauss sampling algorithm.
Optionally, sampling module, for being carried out again in vertex position to light-maps using minimum distance sampling algorithm
Sampling obtains baking Lighting information.
Optionally, above-mentioned apparatus further include: removing module, for deleting light-maps.
Optionally, processing module comprises determining that unit, for determining current tri patch to be rendered in threedimensional model;
Acquiring unit, for obtaining the baking Lighting information of each vertex pixel from the vertex color of current tri patch to be rendered;
Processing unit, for obtaining using Lighting information is baked to the interior pixels progress interpolation processing of current tri patch to be rendered
To the baking Lighting information of interior pixels;Rendering unit, for the baking Lighting information and internal picture using each vertex pixel
The baking Lighting information of element renders current tri patch to be rendered;Judging unit is in threedimensional model for judging
It is no to there is the tri patch not yet rendered, if it is, determination unit is returned to, if it is not, then rendering terminates.
Optionally, above-mentioned apparatus further include: setup module, it is mutually independent for being used in the vertex color of threedimensional model
Memory space stores the baking Lighting information of the public vertex position of adjacent triangular faces respectively.
A wherein embodiment according to the present invention additionally provides a kind of storage medium, and storage medium includes the program of storage,
In, in program operation, equipment where control storage medium executes the rendering method of the threedimensional model of above-mentioned any one.
A wherein embodiment according to the present invention, additionally provides a kind of processor, which is characterized in that processor is for running journey
Sequence, wherein program executes the rendering method of the threedimensional model of above-mentioned any one when running.
A wherein embodiment according to the present invention, additionally provides a kind of terminal, comprising: one or more processors, memory,
Display device and one or more program, wherein one or more programs are stored in memory, and be configured as by
One or more processors execute, and one or more programs are used to execute the rendering method of the threedimensional model of above-mentioned any one.
In the present invention at least partly embodiment, baking processing is carried out using to scene of game, obtains light-maps, and
The vertex position of threedimensional model carries out resampling to light-maps in scene of game, obtains the baking illumination letter of vertex position
Breath, and the mode into the vertex color of threedimensional model is stored by Lighting information is baked, according to the baking illumination stored in the color of vertex
Information renders threedimensional model, has reached to significantly reduce under the premise of ensuring City scenarios rendering effect and is consumed
The purpose of terminal storage space can satisfy so that realizing effectively control bakes the occupied memory space of data multiple
The technical effect of the demand of high quality rendering effect is presented in miscellaneous scene of game, and then solves provided base in the related technology
A large amount of memory space is easily occupied in the rendering mode of light-maps, it is difficult to the technical issues of being suitable for complicated scene of game.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair
Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 shows a kind of hardware of the terminal (or mobile device) of rendering method for realizing threedimensional model
Structural block diagram;
Fig. 2 is the wherein flow chart of the rendering method of the threedimensional model of an embodiment according to the present invention;
Fig. 3 is the schematic diagram of the baking light-maps of a wherein alternative embodiment according to the present invention;
Fig. 4 is the wherein signal of an alternative embodiment sampled in vertex position to light-maps according to the present invention
Figure;
Fig. 5 is the wherein structural block diagram of the rendering device of the threedimensional model of an embodiment according to the present invention;
Fig. 6 is the wherein structural block diagram of the rendering device of the threedimensional model of an alternative embodiment according to the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work
It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way
Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or
Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover
Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to
Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product
Or other step or units that equipment is intrinsic.
A wherein embodiment according to the present invention, provides a kind of embodiment of the rendering method of threedimensional model, needs to illustrate
, step shown in the flowchart of the accompanying drawings can hold in a computer system such as a set of computer executable instructions
Row, although also, logical order is shown in flow charts, and it in some cases, can be to be different from sequence herein
Execute shown or described step.
This method embodiment can execute in mobile terminal, terminal or similar arithmetic unit.Fig. 1 is shown
A kind of hardware block diagram of the terminal (or mobile device) of rendering method for realizing threedimensional model.Such as Fig. 1
Shown, terminal 10 (or mobile device) may include that one or more (is come in figure using 102a, 102b ... ..., 102n
Showing) (processor 102 can include but is not limited to central processing unit (CPU), graphics processor (GPU), number to processor 102
The processing unit of signal processing (DSP) chip, microprocessor (MCU) or programmable logic device (FPGA) etc.), for storing number
According to memory 104 and for the transmitting device of communication function.It in addition to this, can also include: display, input/output
Interface (I/O interface), the port universal serial bus (USB) (a port that can be used as in the port of I/O interface is included),
Network interface, power supply and/or camera.It will appreciated by the skilled person that structure shown in FIG. 1 is only to illustrate, simultaneously
The structure of above-mentioned terminal 10 (or mobile device) is not caused to limit.For example, terminal 10 (or mobile device)
It may also include than shown in Fig. 1 more perhaps less component or with the configuration different from shown in Fig. 1.
It is to be noted that said one or multiple processors 102 and/or other data processing circuits lead to herein
Can often " data processing circuit " be referred to as.The data processing circuit all or part of can be presented as software, hardware, firmware
Or any other combination.In addition, data processing circuit for single independent processing module or all or part of can be integrated to meter
In any one in other elements in calculation machine terminal 10 (or mobile device).As involved in the embodiment of the present application,
The data processing circuit controls (such as the selection for the variable resistance end path connecting with interface) as a kind of processor.
Memory 104 can be used for storing the software program and module of application software, such as the three-dimensional in the embodiment of the present invention
Corresponding program instruction/the data storage device of the rendering method of model, processor 102 are stored in memory 104 by operation
Software program and module realize the wash with watercolours of above-mentioned threedimensional model thereby executing various function application and data processing
Dyeing method.Memory 104 may include high speed random access memory, may also include nonvolatile memory, such as one or more magnetic
Property storage device, flash memory or other non-volatile solid state memories.In some instances, memory 104 can further comprise
The memory remotely located relative to processor 102, these remote memories can pass through network connection to terminal 10.
The example of above-mentioned network includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Transmitting device is used to that data to be received or sent via a network.Above-mentioned network specific example may include calculating
The wireless network that the communication providers of machine terminal 10 provide.In an example, transmitting device includes a network adapter
(Network Interface Controller, referred to as NIC), can be connected by base station with other network equipments so as to
It is communicated with internet.In an example, transmitting device can be radio frequency (Radio Frequency, referred to as RF) mould
Block is used to wirelessly be communicated with internet.
Display can such as touch-screen type liquid crystal display (LCD), the liquid crystal display aloow user with
The user interface of terminal 10 (or mobile device) interacts.In some embodiments, above-mentioned computer shown in FIG. 1
Terminal 10 (or mobile device) has touch display (also referred to as " touch screen " or " touch display screen ").In some embodiments
In, above-mentioned terminal 10 (or mobile device) shown in FIG. 1 has graphic user interface (GUI), and user can pass through touching
The finger contact and/or gesture touched on touch sensitive surface to carry out human-computer interaction with GUI, and human-computer interaction function herein optionally wraps
Include following interaction: creation webpage, drawing, word processing, production electronic document, game, video conference, instant messaging, transmitting-receiving electricity
Sub- mail, call interface play digital video, playback digital music and/or web browsing etc., for executing above-mentioned human-computer interaction
The executable instruction of function is configured/is stored in the executable computer program product of one or more processors or readable storage
In medium.
Above-mentioned terminal 10 (or mobile device) can be smart phone (such as Android phone, iOS mobile phone),
The terminals such as tablet computer, applause computer and mobile internet device (Mobile Internet Devices, MID), PAD are set
It is standby.
The wash with watercolours that one kind runs on the threedimensional model of above-mentioned terminal (or mobile device) is provided in the present embodiment
Dyeing method applied to automatically generating architecture ensemble scene, and makes groups of building support the rendering effect of night window bright light.Fig. 2
It is the wherein flow chart of the rendering method of the threedimensional model of an embodiment according to the present invention, as shown in Fig. 2, this method includes as follows
Step:
Step S22 carries out baking processing to scene of game, obtains light-maps;
Step S24, the vertex position of threedimensional model carries out resampling to light-maps in scene of game, obtains vertex
The baking Lighting information of position, and store Lighting information is baked into the vertex color of threedimensional model, wherein threedimensional model includes
Multiple tri patch;
Step S26 renders threedimensional model according to the baking Lighting information stored in the color of vertex.
Through the above steps, light-maps can be obtained, and in sports ground using baking processing is carried out to scene of game
The vertex position of threedimensional model carries out resampling to light-maps in scape, obtains the baking Lighting information of vertex position, and will
It bakes Lighting information and stores the mode into the vertex color of threedimensional model, according to the baking Lighting information stored in the color of vertex to three
Dimension module is rendered, and has been reached terminal consumed by capable of significantly reducing under the premise of ensuring City scenarios rendering effect and has been deposited
The purpose in space is stored up, so that realizing effectively control bakes the occupied memory space of data, can satisfy in complicated sports ground
The technical effect of the demand of high quality rendering effect is presented in scape, and then solves provided based on illumination patch in the related technology
The rendering mode of figure easily occupies a large amount of memory space, it is difficult to the technical issues of being suitable for complicated scene of game.
Illumination used in game can be generally divided into direct illumination and indirect light shines.Direct illumination refers to that light source is direct
On influence caused by illuminated object.And indirect light shines and refers to that illumination is passed through after rebound several times in scene of game to quilt
It is influenced caused by irradiation object.Direct illumination, which generallys use the mode calculated in real time, can be obtained.And indirect light shines and then needs
Complicated integral operation needs to carry out thus to bake calculating offline.What is stored in light-maps in baking process is irradiation level
Information, this is a low frequency signal.Meanwhile enhancing control force to scene effect in game, it will usually shine indirect light
Information bakes in light-maps, and directly illumination part is then completed by the way of calculating in real time.In addition, indirect light shine with
Direct illumination is compared, and frequency is lower.According to the above analysis, it is found that baking information, there are biggish compression spaces.
The effective technology means that compression bakes information are: reducing used sampled point quantity when baking scene.
In order to ensure still being able to be shown important feature in scene of game under the premise of reducing sampled point quantity, need using
To the vertex position of model.In view of the important models and important area in scene of game, model face number can be correspondinglyd increase,
When model vertices location arrangements sampled point, the important feature of scene of game is easily captured.And for other insignificant models and area
Domain, alternatively, the region that the game role that game player is manipulated can not reach, model accuracy can significantly reduce, it is it therefore
The sampled point of distribution also can be reduced correspondingly.By above-mentioned sampling point distributions mode, important models and region both may insure
Rendering effect, while the occupied memory space of baking information that insignificant model and region can also be reduced, and then greatly
Alleviate backpack body pressure caused by baking.
Optionally, in step s 24, resampling is carried out to light-maps in vertex position, obtains baking Lighting information
May include step performed below:
Step S241 carries out resampling to light-maps in vertex position using default sampling algorithm, obtains baking light
According to information, wherein default sampling algorithm includes following one: minimum distance sampling algorithm, line sampling algorithm, Gauss, which samples, to be calculated
Method.
In optional implementation process, preferentially light-maps are carried out again in vertex position using minimum distance sampling algorithm
Sampling obtains baking Lighting information.
It after getting initial game scene, needs to bake initial game scene, obtain and initial game field
The corresponding light-maps of scape.Since baking system uses global illumination algorithm, development cost is higher, therefore, as logical as possible
Development cost can be efficiently reduced by crossing the tools chain that multiplexing provides in the related technology.Fig. 3 is wherein one optional according to the present invention
The schematic diagram of the baking light-maps of embodiment, as shown in figure 3, triangle indicates that one of tri patch of threedimensional model shows
Example, dot are expressed as the light-maps sampled point that threedimensional model generates in initial game scene.
After getting light-maps, resampling is carried out to light-maps in threedimensional model vertex position, to obtain
The baking Lighting information of vertex position, and store Lighting information is baked into vertex color, for being used when follow-up operation.Again
During sampling, need to compare different sampling algorithms (such as: minimum distance sampling algorithm, line sampling algorithm, Gauss sampling
Algorithm) influence to final rendering effect.In an alternate embodiment of the present invention where, by minimum distance sampling algorithm,
Line sampling algorithm and Gauss sampling algorithm carry out global alignment, determine and execute sampling behaviour using minimum distance sampling algorithm
Make, reason is: being on the one hand that the computing cost that minimum distance samples is minimum, another aspect minimum distance samples not vulnerable to week
The influence of surrounding environment.
Fig. 4 is the wherein signal of an alternative embodiment sampled in vertex position to light-maps according to the present invention
Figure is adopted as shown in figure 4, dashed circle indicates the sample range of each vertex position in tri patch by using minimum distance
Sample algorithm executes sampling operation, can obtain the baking Lighting information of each vertex position in tri patch.Baking illumination letter
Breath can be stored into the vertex color of each vertex position.
Optionally, it in step S24, while Lighting information will be baked storing to the vertex color of threedimensional model, can also wrap
Include step performed below:
Step S25 deletes light-maps.
As described above, thus being avoided by storing the irradiation level information in scene of game into light-maps as vertex
It bakes and customizes additional baking system.In addition, sampled based on light-maps in model vertices position, and by sampled result
While storage to model vertices color, it is also necessary to delete light-maps.For light-maps, vertex color is occupied to be deposited
Storage space can significantly decline.
Optionally, in step S26, being rendered according to the baking Lighting information stored in the color of vertex to threedimensional model can
To include step performed below:
Step S261 determines current tri patch to be rendered in threedimensional model;
Step S262 obtains the baking illumination letter of each vertex pixel from the vertex color of current tri patch to be rendered
Breath;
Step S263 carries out at interpolation the interior pixels of current tri patch to be rendered using Lighting information is baked
Reason, obtains the baking Lighting information of interior pixels;
Step S264, using the baking Lighting information for baking Lighting information and interior pixels of each vertex pixel to current
Tri patch to be rendered is rendered;
Step S265 judges with the presence or absence of the tri patch not yet rendered in threedimensional model, if it is, return step
S261, if it is not, then rendering terminates.
In game actual moving process, since threedimensional model is composed of multiple tri patch, in scene of game more
The threedimensional model wanted is aggravated, the model face number for being included can correspondingly increase, therefore, for multiple tri patch, need to control
Tinter (shader) carries out coloring treatment to each tri patch one by one.Specifically, it is first determined in threedimensional model currently to
The tri patch of rendering;Secondly, control shader obtains the baking light of each vertex pixel from the vertex color of the tri patch
According to information;Then, control shader using each vertex pixel bake Lighting information to the interior pixels of the tri patch into
Row interpolation processing, to obtain the baking Lighting information of interior pixels;Subsequently, control shader is using each vertex pixel
The baking Lighting information for baking Lighting information and interior pixels renders the tri patch;Finally, judging in threedimensional model
With the presence or absence of the tri patch not yet rendered, if it is, continuing to determine next tri patch to be rendered, then repeat
Implementation procedure is stated, until the rendering of entire threedimensional model terminates.
Optionally, the above method can also include step performed below:
Step S27 stores adjacent triangle using mutually independent memory space in the vertex color of threedimensional model respectively
The baking Lighting information of the public vertex position of dough sheet.
The same vertex position, the vertex of the threedimensional model are shared in view of will appear multiple tri patch in threedimensional model
The baking illumination that the vertex position is located at different tri patch will be stored respectively in color using mutually independent memory space
Information, to avoid carrying out causing to interfere with each other in coloring process to the adjacent triangular faces for sharing the same vertex position.Example
Such as: three vertex of tri patch 1 are respectively vertex A, vertex B and vertex C, and three vertex of tri patch 2 are respectively vertex
A, vertex B and vertex D.It follows that tri patch 1 and tri patch 2 are two adjacent dough sheets in threedimensional model, and vertex A
It is public vertex position with vertex B.At this point, being stored in the vertex color of the vertex A of threedimensional model using the first memory space
Vertex A is located at the baking Lighting information of tri patch 1, and stores vertex A using the second memory space and be located at tri patch 2
Baking Lighting information.Similarly, vertex B is stored using the first memory space in the vertex color of the vertex B of threedimensional model
In the baking Lighting information of tri patch 1, and store using the second memory space the baking that vertex B is located at tri patch 2
Lighting information.
By a large amount of scrnario testings, the result shows that, the baking data that the embodiment of the present invention uses are occupied that memory space is
Light-maps are occupied to obtain 30% or so of memory space, can be fully adapted to complicated scene of game, and being capable of effective twelve Earthly Branches
Hold the implementation that this kind of needs of such as Day-night shift cover light-maps more.Mode is baked by using vertex, with a 4K*4K
Complicated City scenarios for, only need to occupy the memory space of MB rank can store daytime and two sets of baking information of night,
Its memory space significantly lower than the GB rank occupied needed for provided light-maps in the related technology.Moreover, vertex bakes
It can also obtain and the extremely approximate rendering effect of light-maps.If scene can further consider shadow complexity in cloth light
Matching between degree and model of place vertex complexity, then the difference on effect that vertex bakes between light-maps will be by nothing
It limits small.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation
The method of example can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but it is very much
In the case of the former be more preferably embodiment.Based on this understanding, technical solution of the present invention is substantially in other words to existing
The part that technology contributes can be embodied in the form of software products, which is stored in a storage
In medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, calculate
Machine, server or network equipment etc.) execute method described in each embodiment of the present invention.
Additionally provide a kind of rendering device of threedimensional model in the present embodiment, the device for realizing above-described embodiment and
Preferred embodiment, the descriptions that have already been made will not be repeated.As used below, predetermined function may be implemented in term " module "
The combination of the software and/or hardware of energy.It is hard although device described in following embodiment is preferably realized with software
The realization of the combination of part or software and hardware is also that may and be contemplated.
Fig. 5 is the wherein structural block diagram of the rendering device of the threedimensional model of an embodiment according to the present invention, as shown in figure 5,
The device includes: to bake module 10 to obtain light-maps for carrying out baking processing to scene of game;Sampling module 20, is used for
The vertex position of threedimensional model carries out resampling to light-maps in scene of game, obtains the baking illumination letter of vertex position
Breath, and store Lighting information is baked into the vertex color of threedimensional model, wherein threedimensional model includes multiple tri patch;Place
Module 30 is managed, for rendering according to the baking Lighting information stored in the color of vertex to threedimensional model.
Optionally, sampling module 20, for being adopted again in vertex position to light-maps using default sampling algorithm
Sample obtains baking Lighting information, wherein default sampling algorithm includes following one: minimum distance sampling algorithm, and line sampling is calculated
Method, Gauss sampling algorithm.
Optionally, sampling module 20, for carrying out weight to light-maps in vertex position using minimum distance sampling algorithm
New sampling obtains baking Lighting information.
Optionally, optionally, Fig. 6 is the wherein knot of the rendering device of the threedimensional model of an alternative embodiment according to the present invention
Structure block diagram, as shown in fig. 6, above-mentioned apparatus further include: removing module 40, for deleting light-maps.
Optionally, processing module 30 comprises determining that unit (not shown), for determining in threedimensional model currently to wash with watercolours
The tri patch of dye;Acquiring unit (not shown), it is every for being obtained from the vertex color of current tri patch to be rendered
The baking Lighting information of a vertex pixel;Processing unit (not shown) bakes Lighting information to currently to wash with watercolours for using
The interior pixels of the tri patch of dye carry out interpolation processing, obtain the baking Lighting information of interior pixels;Rendering unit is (in figure not
Show), for the baking Lighting information for baking Lighting information and interior pixels using each vertex pixel to current to be rendered
Tri patch rendered;Judging unit (not shown), for judging in threedimensional model with the presence or absence of not yet rendering
Tri patch, if it is, determination unit is returned to, if it is not, then rendering terminates.
Optionally, as shown in fig. 6, above-mentioned apparatus further include: setup module 50, for being adopted in the vertex color of threedimensional model
Store the baking Lighting information of the public vertex position of adjacent triangular faces respectively with mutually independent memory space.
It should be noted that above-mentioned modules can be realized by software or hardware, for the latter, Ke Yitong
Following manner realization is crossed, but not limited to this: above-mentioned module is respectively positioned in same processor;Alternatively, above-mentioned modules are with any
Combined form is located in different processors.
The embodiments of the present invention also provide a kind of storage medium, computer program is stored in the storage medium, wherein
The computer program is arranged to execute the step in any of the above-described embodiment of the method when operation.
Optionally, in the present embodiment, above-mentioned storage medium can be set to store by executing based on following steps
Calculation machine program:
S1 carries out baking processing to scene of game, obtains light-maps;
S2, the vertex position of threedimensional model carries out resampling to light-maps in scene of game, obtains vertex position
Baking Lighting information, and by bake Lighting information store into the vertex color of threedimensional model, wherein threedimensional model includes multiple
Tri patch;
S3 renders threedimensional model according to the baking Lighting information stored in the color of vertex.
Optionally, in the present embodiment, above-mentioned storage medium can include but is not limited to: USB flash disk, read-only memory (Read-
Only Memory, referred to as ROM), it is random access memory (Random Access Memory, referred to as RAM), mobile hard
The various media that can store computer program such as disk, magnetic or disk.
The embodiments of the present invention also provide a kind of processor, which is arranged to run computer program to execute
Step in any of the above-described embodiment of the method.
Optionally, in the present embodiment, above-mentioned processor can be set to execute following steps by computer program:
S1 carries out baking processing to scene of game, obtains light-maps;
S2, the vertex position of threedimensional model carries out resampling to light-maps in scene of game, obtains vertex position
Baking Lighting information, and by bake Lighting information store into the vertex color of threedimensional model, wherein threedimensional model includes multiple
Tri patch;
S3 renders threedimensional model according to the baking Lighting information stored in the color of vertex.
Optionally, the specific example in the present embodiment can be with reference to described in above-described embodiment and optional embodiment
Example, details are not described herein for the present embodiment.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment
The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others
Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, Ke Yiwei
A kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or
Person is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module
It connects, can be electrical or other forms.
The unit illustrated as separation assembly may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
On unit.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product
When, it can store in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the present invention whole or
Part steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are deposited
Reservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program code
Medium.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.
Claims (15)
1. a kind of rendering method of threedimensional model characterized by comprising
Baking processing is carried out to scene of game, obtains light-maps;
The vertex position of threedimensional model carries out resampling to the light-maps in the scene of game, obtains vertex position
Baking Lighting information, and the baking Lighting information is stored into the vertex color of the threedimensional model, wherein the three-dimensional
Model includes multiple tri patch;
The threedimensional model is rendered according to the baking Lighting information stored in the vertex color.
2. the method according to claim 1, wherein being carried out again in the vertex position to the light-maps
Sampling, obtaining the baking Lighting information includes:
Resampling is carried out to the light-maps in the vertex position using default sampling algorithm, obtains the baking illumination
Information, wherein the default sampling algorithm includes following one: minimum distance sampling algorithm, line sampling algorithm, Gauss sampling
Algorithm.
3. the method according to claim 1, wherein using minimum distance sampling algorithm in the vertex position pair
The light-maps carry out resampling, obtain the baking Lighting information.
4. the method according to claim 1, wherein storing by the baking Lighting information to the three-dimensional mould
While the vertex color of type, further includes:
Delete the light-maps.
5. the method according to claim 1, wherein being believed according to the baking illumination stored in the vertex color
Breath carries out rendering to the threedimensional model
It determines step, determines current tri patch to be rendered in the threedimensional model;
Obtaining step obtains the baking illumination letter of each vertex pixel from the vertex color of the current tri patch to be rendered
Breath;
Processing step carries out interpolation using interior pixels of the baking Lighting information to the current tri patch to be rendered
Processing, obtains the baking Lighting information of the interior pixels;
Rendering step, using the baking Lighting information for baking Lighting information and the interior pixels of each vertex pixel to described
Current tri patch to be rendered is rendered;
Judgment step judges with the presence or absence of the tri patch not yet rendered in the threedimensional model, if it is, returning described true
Step is determined, if it is not, then rendering terminates.
6. the method according to claim 1, wherein the method also includes:
Store the public affairs of adjacent triangular faces respectively using mutually independent memory space in the vertex color of the threedimensional model
The baking Lighting information of vertex position altogether.
7. a kind of rendering device of threedimensional model characterized by comprising
It bakes module and obtains light-maps for carrying out baking processing to scene of game;
Sampling module, the vertex position for the threedimensional model in the scene of game adopt the light-maps again
Sample obtains the baking Lighting information of vertex position, and the baking Lighting information is stored to the vertex color of the threedimensional model
In, wherein the threedimensional model includes multiple tri patch;
Processing module, for carrying out wash with watercolours to the threedimensional model according to the baking Lighting information stored in the vertex color
Dye.
8. device according to claim 7, which is characterized in that the sampling module, for being existed using default sampling algorithm
The vertex position carries out resampling to the light-maps, obtains the baking Lighting information, wherein the default sampling
Algorithm includes following one: minimum distance sampling algorithm, line sampling algorithm, Gauss sampling algorithm.
9. device according to claim 8, which is characterized in that the sampling module, for being calculated using minimum distance sampling
Method carries out resampling to the light-maps in the vertex position, obtains the baking Lighting information.
10. device according to claim 7, which is characterized in that described device further include:
Removing module, for deleting the light-maps.
11. device according to claim 7, which is characterized in that the processing module includes:
Determination unit, for determining current tri patch to be rendered in the threedimensional model;
Acquiring unit, for obtaining the baking light of each vertex pixel from the vertex color of the current tri patch to be rendered
According to information;
Processing unit, for being carried out using interior pixels of the baking Lighting information to the current tri patch to be rendered
Interpolation processing obtains the baking Lighting information of the interior pixels;
Rendering unit, the baking Lighting information pair for baking Lighting information and the interior pixels using each vertex pixel
The current tri patch to be rendered is rendered;
Judging unit, for judging with the presence or absence of the tri patch not yet rendered in the threedimensional model, if it is, returning to institute
Determination unit is stated, if it is not, then rendering terminates.
12. device according to claim 7, which is characterized in that described device further include:
Setup module, for adjacent to store respectively using mutually independent memory space in the vertex color of the threedimensional model
The baking Lighting information of the public vertex position of tri patch.
13. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program
When control the storage medium where equipment perform claim require any one of 1 to 6 described in threedimensional model rendering method.
14. a kind of processor, which is characterized in that the processor is for running program, wherein right of execution when described program is run
Benefit require any one of 1 to 6 described in threedimensional model rendering method.
15. a kind of terminal characterized by comprising one or more processors, memory, display device and one or more
A program, wherein one or more of programs are stored in the memory, and are configured as by one or more
A processor executes, and one or more of programs are for threedimensional model described in any one of perform claim requirement 1 to 6
Rendering method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910353674.2A CN109903385A (en) | 2019-04-29 | 2019-04-29 | Rendering method, device, processor and the terminal of threedimensional model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910353674.2A CN109903385A (en) | 2019-04-29 | 2019-04-29 | Rendering method, device, processor and the terminal of threedimensional model |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109903385A true CN109903385A (en) | 2019-06-18 |
Family
ID=66956570
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910353674.2A Pending CN109903385A (en) | 2019-04-29 | 2019-04-29 | Rendering method, device, processor and the terminal of threedimensional model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109903385A (en) |
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110390709A (en) * | 2019-06-19 | 2019-10-29 | 北京巴别时代科技股份有限公司 | The round and smooth method of cartoon rendering crisperding |
CN110570510A (en) * | 2019-09-10 | 2019-12-13 | 珠海天燕科技有限公司 | Method and device for generating material map |
CN110599574A (en) * | 2019-09-17 | 2019-12-20 | 网易(杭州)网络有限公司 | Rendering method and device of game scene and electronic equipment |
CN110675479A (en) * | 2019-10-14 | 2020-01-10 | 北京代码乾坤科技有限公司 | Dynamic illumination processing method and device, storage medium and electronic device |
CN110738733A (en) * | 2019-10-14 | 2020-01-31 | 北京代码乾坤科技有限公司 | Three-dimensional terrain model generation method, storage medium, processor and electronic device |
CN110992494A (en) * | 2019-12-17 | 2020-04-10 | 米哈游科技(上海)有限公司 | Dissipation method, device, equipment and storage medium of role model |
CN111127322A (en) * | 2019-12-24 | 2020-05-08 | 北京像素软件科技股份有限公司 | Method and device for processing seams of topographic map |
CN111540024A (en) * | 2020-04-21 | 2020-08-14 | 网易(杭州)网络有限公司 | Model rendering method and device, electronic equipment and storage medium |
CN111882677A (en) * | 2020-08-04 | 2020-11-03 | 网易(杭州)网络有限公司 | Method and device for editing three-dimensional plant model, electronic equipment and storage medium |
CN111882631A (en) * | 2020-07-24 | 2020-11-03 | 上海米哈游天命科技有限公司 | Model rendering method, device, equipment and storage medium |
CN111932664A (en) * | 2020-08-27 | 2020-11-13 | 腾讯科技(深圳)有限公司 | Image rendering method and device, electronic equipment and storage medium |
CN112489203A (en) * | 2020-12-08 | 2021-03-12 | 网易(杭州)网络有限公司 | Model processing method, model processing apparatus, electronic device, and storage medium |
CN112509108A (en) * | 2020-12-03 | 2021-03-16 | 杭州群核信息技术有限公司 | GPU-based vertex ambient light shading generation method and image rendering method |
CN113144611A (en) * | 2021-03-16 | 2021-07-23 | 网易(杭州)网络有限公司 | Scene rendering method and device, computer storage medium and electronic equipment |
CN113262480A (en) * | 2021-05-13 | 2021-08-17 | 网易(杭州)网络有限公司 | Baking method and device for three-dimensional scene |
CN113516751A (en) * | 2020-03-26 | 2021-10-19 | 网易(杭州)网络有限公司 | In-game cloud display method and device and electronic terminal |
CN113694516A (en) * | 2020-05-20 | 2021-11-26 | 福建天晴在线互动科技有限公司 | Method and system for switching baking data in real time based on illumination environment |
CN114037811A (en) * | 2021-11-18 | 2022-02-11 | 北京优锘科技有限公司 | 3D temperature field graph rendering method, apparatus, medium, and device based on directed distance field |
CN115830286A (en) * | 2023-02-15 | 2023-03-21 | 武汉天恒信息技术有限公司 | Baking method for keeping consistent amount of three-dimensional scene texture definition |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108257204A (en) * | 2016-12-28 | 2018-07-06 | 福建省天奕网络科技有限公司 | The vertex color for applying to Unity engines draws baking method and system |
-
2019
- 2019-04-29 CN CN201910353674.2A patent/CN109903385A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108257204A (en) * | 2016-12-28 | 2018-07-06 | 福建省天奕网络科技有限公司 | The vertex color for applying to Unity engines draws baking method and system |
Cited By (30)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110390709A (en) * | 2019-06-19 | 2019-10-29 | 北京巴别时代科技股份有限公司 | The round and smooth method of cartoon rendering crisperding |
CN110570510A (en) * | 2019-09-10 | 2019-12-13 | 珠海天燕科技有限公司 | Method and device for generating material map |
CN110570510B (en) * | 2019-09-10 | 2023-04-18 | 郑州阿帕斯科技有限公司 | Method and device for generating material map |
CN110599574A (en) * | 2019-09-17 | 2019-12-20 | 网易(杭州)网络有限公司 | Rendering method and device of game scene and electronic equipment |
CN110599574B (en) * | 2019-09-17 | 2023-09-15 | 网易(杭州)网络有限公司 | Game scene rendering method and device and electronic equipment |
CN110675479A (en) * | 2019-10-14 | 2020-01-10 | 北京代码乾坤科技有限公司 | Dynamic illumination processing method and device, storage medium and electronic device |
CN110738733A (en) * | 2019-10-14 | 2020-01-31 | 北京代码乾坤科技有限公司 | Three-dimensional terrain model generation method, storage medium, processor and electronic device |
CN110675479B (en) * | 2019-10-14 | 2023-05-16 | 北京代码乾坤科技有限公司 | Dynamic illumination processing method and device, storage medium and electronic device |
CN110992494A (en) * | 2019-12-17 | 2020-04-10 | 米哈游科技(上海)有限公司 | Dissipation method, device, equipment and storage medium of role model |
CN110992494B (en) * | 2019-12-17 | 2023-08-25 | 米哈游科技(上海)有限公司 | Role model dissipation method, device, equipment and storage medium |
CN111127322A (en) * | 2019-12-24 | 2020-05-08 | 北京像素软件科技股份有限公司 | Method and device for processing seams of topographic map |
CN111127322B (en) * | 2019-12-24 | 2024-02-27 | 北京像素软件科技股份有限公司 | Terrain illumination map joint processing method and device |
CN113516751B (en) * | 2020-03-26 | 2023-06-30 | 网易(杭州)网络有限公司 | Method and device for displaying cloud in game and electronic terminal |
CN113516751A (en) * | 2020-03-26 | 2021-10-19 | 网易(杭州)网络有限公司 | In-game cloud display method and device and electronic terminal |
CN111540024A (en) * | 2020-04-21 | 2020-08-14 | 网易(杭州)网络有限公司 | Model rendering method and device, electronic equipment and storage medium |
CN111540024B (en) * | 2020-04-21 | 2024-02-23 | 网易(杭州)网络有限公司 | Model rendering method and device, electronic equipment and storage medium |
CN113694516A (en) * | 2020-05-20 | 2021-11-26 | 福建天晴在线互动科技有限公司 | Method and system for switching baking data in real time based on illumination environment |
CN113694516B (en) * | 2020-05-20 | 2023-09-15 | 福建天晴在线互动科技有限公司 | Method and system for switching baking data in real time based on illumination environment |
CN111882631A (en) * | 2020-07-24 | 2020-11-03 | 上海米哈游天命科技有限公司 | Model rendering method, device, equipment and storage medium |
CN111882677A (en) * | 2020-08-04 | 2020-11-03 | 网易(杭州)网络有限公司 | Method and device for editing three-dimensional plant model, electronic equipment and storage medium |
CN111882677B (en) * | 2020-08-04 | 2024-02-23 | 网易(杭州)网络有限公司 | Method and device for editing three-dimensional plant model, electronic equipment and storage medium |
CN111932664A (en) * | 2020-08-27 | 2020-11-13 | 腾讯科技(深圳)有限公司 | Image rendering method and device, electronic equipment and storage medium |
CN111932664B (en) * | 2020-08-27 | 2023-06-23 | 腾讯科技(深圳)有限公司 | Image rendering method and device, electronic equipment and storage medium |
CN112509108A (en) * | 2020-12-03 | 2021-03-16 | 杭州群核信息技术有限公司 | GPU-based vertex ambient light shading generation method and image rendering method |
CN112489203A (en) * | 2020-12-08 | 2021-03-12 | 网易(杭州)网络有限公司 | Model processing method, model processing apparatus, electronic device, and storage medium |
CN113144611A (en) * | 2021-03-16 | 2021-07-23 | 网易(杭州)网络有限公司 | Scene rendering method and device, computer storage medium and electronic equipment |
CN113262480A (en) * | 2021-05-13 | 2021-08-17 | 网易(杭州)网络有限公司 | Baking method and device for three-dimensional scene |
CN114037811B (en) * | 2021-11-18 | 2022-05-27 | 北京优锘科技有限公司 | 3D temperature field graph rendering method, apparatus, medium, and device based on directed distance field |
CN114037811A (en) * | 2021-11-18 | 2022-02-11 | 北京优锘科技有限公司 | 3D temperature field graph rendering method, apparatus, medium, and device based on directed distance field |
CN115830286A (en) * | 2023-02-15 | 2023-03-21 | 武汉天恒信息技术有限公司 | Baking method for keeping consistent amount of three-dimensional scene texture definition |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109903385A (en) | Rendering method, device, processor and the terminal of threedimensional model | |
CN111009026B (en) | Object rendering method and device, storage medium and electronic device | |
CN110211218B (en) | Picture rendering method and device, storage medium and electronic device | |
WO2022042436A1 (en) | Image rendering method and apparatus, and electronic device and storage medium | |
CN109939440A (en) | Generation method, device, processor and the terminal of 3d gaming map | |
CN106898040B (en) | Virtual resource object rendering method and device | |
CN109603155A (en) | Merge acquisition methods, device, storage medium, processor and the terminal of textures | |
CN107886562A (en) | Water surface rendering intent, device and readable storage medium storing program for executing | |
CN108579082A (en) | The method, apparatus and terminal of shadow are shown in game | |
CN108074278A (en) | Video presentation method, device and equipment | |
CN110148203A (en) | The generation method of Virtual Building model, device, processor and terminal in game | |
US20230120253A1 (en) | Method and apparatus for generating virtual character, electronic device and readable storage medium | |
CN110298780A (en) | Map rendering method, device and computer storage medium | |
CN111476851B (en) | Image processing method, device, electronic equipment and storage medium | |
CN108681773A (en) | Accelerated method, device, terminal and the readable storage medium storing program for executing of data operation | |
CN106575158A (en) | Environmentally mapped virtualization mechanism | |
CN110069125A (en) | The control method and device of virtual objects | |
CN107393502B (en) | Technology for multipass rendering | |
CN108335342A (en) | Method, equipment and the computer program product of more people's drawing are carried out in web browser | |
CN114842120A (en) | Image rendering processing method, device, equipment and medium | |
CN109724617A (en) | A kind of method for drafting and relevant device of navigation routine | |
CN108351810A (en) | Extension for virtualizing graphics processing | |
CN110221689B (en) | Space drawing method based on augmented reality | |
CN109448123A (en) | The control method and device of model, storage medium, electronic equipment | |
WO2020174488A1 (en) | Programmatic hairstyle opacity compositing for 3d rendering |
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 |