CN105094920B - A kind of game rendering intent and device - Google Patents

A kind of game rendering intent and device Download PDF

Info

Publication number
CN105094920B
CN105094920B CN201510499531.4A CN201510499531A CN105094920B CN 105094920 B CN105094920 B CN 105094920B CN 201510499531 A CN201510499531 A CN 201510499531A CN 105094920 B CN105094920 B CN 105094920B
Authority
CN
China
Prior art keywords
texture
time
memory
game
loaded
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.)
Active
Application number
CN201510499531.4A
Other languages
Chinese (zh)
Other versions
CN105094920A (en
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 CN201510499531.4A priority Critical patent/CN105094920B/en
Publication of CN105094920A publication Critical patent/CN105094920A/en
Application granted granted Critical
Publication of CN105094920B publication Critical patent/CN105094920B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Generation (AREA)

Abstract

The invention discloses a kind of game rendering intent and device, the game rendering intent includes:When game resource loads, the load path of texture used in current game scene is recorded;Obtain grid to be rendered in current game scene;Detect whether the texture used in the grid to be rendered is loaded into memory;When the texture is not loaded, according to the load path of the texture, Asynchronous loading is carried out so that the texture is loaded into memory, and skip to the texture in the rendering for currently rendering batch to the texture by background thread;When the texture has been loaded completion, the texture is submitted into rendering engine and is rendered.The present invention is controlled by the render process to texture, texture occupied memory headroom when substantially reducing game running.

Description

A kind of game rendering intent and device
Technical field
The present invention relates to field of computer technology more particularly to a kind of game rendering intents and device.
Background technology
Occupied memory is the important indicator of evaluation game or software quality when game or running software.It is with game Example, during computer or running of mobile terminal are played, the memory that game running occupies is smaller, tends to concede more moneys Source makes the operation of other programs of user while operation more smooth.China on the market there is a large amount of low-end mobile phone, it is major In order to bring down prices often using very low hardware configuration, mobile phone EMS memory is less than normal for operator and mobile phone manufacturer, when game is transported When capable memory requirements is more than the maximum memory of mobile phone, it will cause game that cannot run.Therefore, game running institute is reduced as possible Need memory can guarantee game can on more machines normal operation so as to obtain more user groups.
At present, the optimal case for reducing memory needed for game running is to do explorer, by explorer to wanting The resource of loading carries out unified management, and unified to explorer application resource when resource loads, explorer is to money The situation that source is referenced externally carries out system analysis, when finding resource not by any object reference, further according to certain strategy Decide whether to discharge resource, for example strategy etc. is not used at most.
It is managed collectively by explorer and undoubtedly obtains relatively better effect, but in specific implementation, It is higher that explorer builds the frame of program requirement.First of all, it is necessary to development of games must use regular MVC frames, The logical layer and key-course of game forms must be completely separable, just can guarantee in Objects hide moneys such as the texture pictures of game Source is discharged without influencing and the relevant data of forms and logic function.It is in addition, more multiple for some resources in game engine Miscellaneous module, such as unity forms UI modules, programmer are often difficult to whether certain texture pictures after determining forms release go back quilt Other places use, it is necessary to go stripping resource and statistics resource information by writing special export plug-in unit.However, many opens Hair quotient will not do this thing or their the problem of just not recognizing committed memory at all, after often having arrived project Phase, all things all have been completed that the successful installation amount of operation platform feedback game is very low or game test organization is anti- Feedback game has various sudden strains of a muscle to move back problem in many low end machines, and developer just goes to seek prioritization scheme.It plays and has opened at this time Distribute into, frame is difficult to change, forms resource because module between dependence can not discharge, it is difficult to again by explorer into How row internal memory optimization carries out internal memory optimization to having developed completion or the game being nearly completed or software, reduces its operation When EMS memory occupation become this field technical barrier.
Invention content
The embodiment of the present invention has been designed to provide a kind of game rendering intent and device, to the render process of texture into Row control, texture occupied memory headroom when reducing game running.
To achieve these goals, an embodiment of the present invention provides a kind of game rendering intent, including:
When game resource loads, the load path of texture used in current game scene is recorded;
Obtain grid to be rendered in current game scene;
Detect whether the texture used in the grid to be rendered is loaded into memory;
When the texture is not loaded, according to the load path of the texture, by background thread to the texture into Line asynchronous loading is skipped to the texture so that the texture is loaded into memory in the rendering for currently rendering batch;
When the texture has been loaded completion, the texture is submitted into rendering engine and is rendered.
Preferably, the texture submitted to after rendering engine rendered, further included described:
Update the render time stamp of the texture;Wherein, the render time stamp is the last for recording the texture The time being rendered.
Further, the game rendering intent further includes:
Every preset time interval, the institute traversed in memory is textured, obtains the render time stamp of the texture;
It is stabbed according to the render time of the texture, when judging that the texture reaches release time, discharges the texture and correspond to Memory headroom.
Wherein, described every preset time interval, the institute traversed in memory is textured, when obtaining the rendering of the texture Between stab, specially:
Every preset time interval, the texture in memory is scanned one by one, judges whether the texture is loaded completion;
When the texture is not loaded completion, the texture is skipped;
When the texture has been loaded completion, the render time stamp of the texture is obtained.
It is described to be stabbed according to the render time of the texture, when judging that the texture reaches release time, discharge the texture Corresponding memory headroom, specially:
Calculate the difference of the render time stamp of current time and the texture;
When the difference is less than release time, the corresponding memory headroom of the texture is not discharged;
When the difference is more than release time, the corresponding memory headroom of the texture is discharged.
In a kind of preferred embodiment, the release time is TRelease
TRelease=Tmin
Wherein, TminFor at least time that preconfigured permission texture stops in memory, Tmin> 0.
In another preferred embodiment, the release time is TRelease
TRelease=Tmin+NAdd in memory*TExtend
Wherein, TminAt least time stopped in memory for preconfigured permission texture;NAdd in memoryFor at current time The texture is loaded into the number in memory in a period of time T before;TExtendA memory is often added in for the texture to prolong Long release time;Tmin> 0;T > 0;TExtend> 0.
Further, the game rendering intent further includes:
After scene of game switching is carried out, the texture used in the first frame picture of scene of game after handover has been loaded Into showing blank screen before;
Alternatively,
After scene of game switching is carried out, a period of time T after scene of game switchingBlank screenInterior display blank screen;Wherein, TBlank screen > 0.
The embodiment of the present invention additionally provides a kind of game rendering device, including:
Load path logging modle, for when game resource loads, recording the loading of texture used in current game scene Path;
Grid acquisition module to be rendered, for obtaining grid to be rendered in current game scene;
Detection module, for detecting whether the texture used in the grid to be rendered is loaded into memory;
Load-on module, for when the texture is not loaded, according to the load path of the texture, passing through background thread Asynchronous loading is carried out to the texture so that the texture is loaded into memory, and skips and batch is currently being rendered to the texture Rendering;With,
Rendering module, for when the texture being loaded completion, the texture being submitted to rendering engine and carries out wash with watercolours Dye.
Preferably, the game rendering device further includes:
Update of time stamp module, for updating the render time of texture stamp;Wherein, the render time stabs to remember Record the time that described texture the last time is rendered.
Preferably, the game rendering device further includes:
Timestamp acquisition module, for every preset time interval, the institute traversed in memory to be textured, obtains the line The render time stamp of reason;With,
Memory release module, for being stabbed according to the render time of the texture, when judging that the texture reaches release time, Discharge the corresponding memory headroom of the texture.
Wherein, the timestamp acquisition module includes:
Texture scanning element, for every preset time interval, scanning the texture in memory one by one, judging the texture Whether completion is loaded;
First do-nothing operation module, for when the texture is not loaded completion, skipping the texture;With,
Timestamp acquiring unit, for when the texture has been loaded completion, obtaining the render time of texture stamp.
The memory release module includes:
Difference computational unit, for calculating the difference of the render time stamp at current time and the texture;
Second do-nothing operation unit, for when the difference is less than release time, not discharging the corresponding memory of the texture Space;With,
Memory releasing unit, for when the difference is more than release time, discharging the corresponding memory headroom of the texture.
In a kind of preferred embodiment, the release time is TRelease
TRelease=Tmin
Wherein, TminFor at least time that preconfigured permission texture stops in memory, Tmin> 0.
In another preferred embodiment, the release time is TRelease
TRelease=Tmin+NAdd in memory*TExtend
Wherein, TminAt least time stopped in memory for preconfigured permission texture;NAdd in memoryFor at current time The texture is loaded into the number in memory in a period of time T before;TExtendA memory is often added in for the texture to prolong Long release time;Tmin> 0;T > 0;TExtend> 0.
Further, the game rendering device further includes the first blank screen module or the second blank screen module;
The first blank screen module, for after scene of game switching is carried out, the first frame of scene of game after handover Texture used in picture is loaded display blank screen before completion;
The second blank screen module, for after scene of game switching is carried out, a period of time after scene of game switching TBlank screenInterior display blank screen;Wherein, TBlank screen> 0.
Existing game rendering intent often may will need to use in current game scene when game resource loads Institute it is textured be fully loaded in memory, when needing to render a certain texture, then directly acquire from memory described Texture, in game running, idle texture occupies a large amount of memory headroom.The present invention skips just when game resource loads Normal texture load phase only records the load path of texture, when detecting that the texture used in grid to be rendered is not loaded, Just the texture is loaded into memory by background thread, texture will not be added before first time render request is not received It is loaded in memory, texture is loaded according to the use demand of texture, substantially reduce texture picture to memory headroom It occupies.
Further, the present invention is the texture configuration render time stamp during texture renders, with described in record The time that texture the last time is rendered when judging that the texture reaches release time, discharges the corresponding memory of the texture Space according to the time that texture the last time renders, discharges the texture resource left unused in memory, reduces game running When occupied memory, advantageously account for low end machines running memory it is insufficient the problem of.
Description of the drawings
Fig. 1 is the flow chart of one embodiment of game rendering intent provided by the invention;
Fig. 2 is the flow chart of another embodiment of game rendering intent provided by the invention;
Fig. 3 is the flow chart for the step S17 that embodiment as shown in Figure 2 provides;
Fig. 4 is the flow chart for the step S18 that embodiment as shown in Figure 2 provides;
Fig. 5 is the flow chart of another embodiment of game rendering intent provided by the invention;
Fig. 6 is the structure diagram of one embodiment of game rendering device provided by the invention;
Fig. 7 is the structure diagram of another embodiment of game rendering device provided by the invention.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.Implement Serial number in example before each step, only for convenience of description, is not construed as the restriction to the execution sequence of each step, in practical operation The execution sequencing of each step may be different, although certain steps are in embodiment ordinal relation, in practical behaviour May also be coordination in work, although conversely, certain steps also may be used in embodiment for coordination in practical operation It can be ordinal relation.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise Lower all other embodiments obtained, shall fall within the protection scope of the present invention.
It is the flow chart of one embodiment of game rendering intent provided by the invention referring to Fig. 1.
The game rendering intent, including step S11~S15:
S11 when game resource loads, records the load path of texture used in current game scene.
Existing game rendering intent generally may will need to use in current game scene when game resource loads Textured (scenery, role and UI in such as scene) be fully loaded in memory, when need to a certain texture carry out wash with watercolours During dye, then the texture is directly acquired from memory, however many textures are not to use always in fact, are loaded into interior In depositing, loading expense was both increased, has also increased EMS memory occupation.For example, certain monster in scene of game may not be one Start to occur as soon as, do not need to render at the very start.It can be until first time needing to use again to it for the texture of this type It is loaded, EMS memory occupation can be effectively reduced and reduces loading expense.The present invention skips normal when game resource loads Texture load phase only records the load path of texture, in follow-up need using the texture, according to the load path It is loaded.
S12 obtains grid to be rendered in current game scene.
The grid to be rendered is the grid not being rendered in current scene, in practical application, can be worked as by traversal All grids in preceding scene, and judge whether the grid is not rendered one by one, when the grid is not rendered, i.e., by institute It states the grid not being rendered and is determined as grid to be rendered.
S13, detects whether the texture used in the grid to be rendered is loaded into memory.In specific implementation, Can be in the render request that game submission renders grid, whether the texture on inspection material ball corresponding with grid It is loaded.
S14, when the texture is not loaded, according to the load path of the texture, by background thread to the line Reason carries out Asynchronous loading so that the texture is loaded into memory, and skips the texture and walked in the rendering of current rendering batch Suddenly.
The texture when the texture has been loaded completion, is submitted to rendering engine and rendered by S15.
In specific implementation, the texture is not other than being loaded and be loaded the state of completion, it is also possible to be in The state being loaded to improve loading efficiency and rendering efficiency, avoids game interim card or interruption, when the texture by During loading, rendering of the present lot to the texture is skipped, i.e.,:Every batch of renders only carries out wash with watercolours to the texture for having loaded completion Dye then directly skips the texture in loading the rendering of present lot, and rendering batch by first after the completion of its loading carries out It renders;And for not starting the texture of loading, then the load step to the texture is triggered, while also skip present lot to the line The rendering of reason.
Game rendering intent provided in this embodiment when game resource loads, skips normal texture load phase, only The load path of texture is recorded, when detecting that the texture used in grid to be rendered is not loaded, just by background thread by institute It states texture to be loaded into memory, texture will not be loaded in memory, before first time render request is not received according to line The use demand of reason loads texture, substantially reduces occupancy of the texture picture to memory headroom.
It is the flow chart of another embodiment of game rendering intent provided by the invention with reference to Fig. 2.The present embodiment is being schemed On the basis of 1 illustrated embodiment, further comprise step S16~S18.
S16 updates the render time stamp of the texture.Wherein, the render time stamp is nearest for recording the texture The time being once rendered.
In specific implementation, when can be used as the rendering of the texture by adding time attribute in the class of the texture Between stab,, then can be by the texture packet when texture obtains the class less than texture when not loading if the more difficult change of game One layer of abstract class is the texture addition render time stamp in the abstract class.
Although the texture is submitted into wash with watercolours described it should be noted that being only gived in Fig. 2 and being set to step S16 The embodiment after engine is rendered is contaminated, it will be appreciated by a person skilled in the art that in each step rendered to texture Rapid front and rear can be stabbed to the render time of the texture is updated, for example, can need the texture being submitted to each Before rendering engine is rendered, when receiving the render request that needs render the texture, that is, find in project The class of texture loader, resource loader or texture is updated the render time stamp of the texture.Can also be, After obtaining grid to be rendered in current game scene, that is, update the render time stamp of texture used in the grid to be rendered.
S17, every preset time interval, the institute traversed in memory is textured, obtains the render time stamp of the texture.
As shown in figure 3, in specific implementation, the step S17 enclosed tool steps S171~S173:
S171 every preset time interval, scans the texture in memory, judges whether the texture has been loaded one by one Into.
S172 when the texture is not loaded completion, skips the texture.
S173 when the texture has been loaded completion, obtains the render time stamp of the texture.
The institute that the present invention is periodically traversed in memory is textured, corresponding to the carry out of texture according to the stress state of texture Operation, the texture usually loaded is to need to be submitted to the texture that rendering engine is rendered, thus when texture also When not being loaded completion, to prevent from interrupting the loading flow of texture, game interim card or interruption are avoided, the texture is not grasped Make, skip the texture, continue to be scanned next texture.And for having loaded the texture of completion, then according to the line The mark of reason reads the time of its last time rendering.The mark of the texture can be the ID or title of the texture, also may be used To be other setting for identifying the other identifier of the texture.
S18 stabs according to the render time of the texture, when judging that the texture reaches release time, discharges the texture Corresponding memory headroom.
Many texture resources in scene of game are not to be constantly in use state in fact, such as certain monster in game Object is likely to occur primary just no longer appearance later, then will no longer be required to submit after its corresponding texture to render, therefore work as institute It states after texture is not rendered and reaches release time whithin a period of time, it should be discharged, to avoid unnecessary interior Deposit occupancy.However, for relative complex game window interfaces, various textures may be included on a window interfaces Picture, and this texture picture is often likely to be used by other window interfaces, and if without detailed statistics, we are very Difficulty knows whether some texture is currently rendered, and when a forms are closed, which can not often be determined Texture is unwanted.If accurately being counted, then need to rely on forms in the related resource of loaded window Texture picture carry out record statistics, and need in a program to change texture display code one by one, to update these systems Meter.
It should be noted that in the embodiment of the present invention although step S17~S18 is seemed and is set to after step S16, It will be understood by those skilled in the art that step S17~S18 is periodic flow, step S11~S16 in specific implementation It can respectively be realized by non-interfering different threads with step S17~S18 and tactful and texture release strategy is rendered to texture Control.
The present embodiment records the time of texture the last time rendering by render time stamp, is stabbed according to render time to memory In texture discharged, without being modified to the original frame of playing, reached good internal memory optimization effect.
As shown in figure 4, include sub-step S181~S183 in specific implementation step S18 described in:
S181 calculates the difference of the render time stamp of current time and the texture.
S182 when the difference is less than release time, does not discharge the corresponding memory headroom of the texture.
S183 when the difference is more than release time, discharges the corresponding memory headroom of the texture.
It should be noted that when the difference be equal to release time when, both can by less than situation handled, do not release Put the corresponding memory headroom of the texture, can also by more than situation handled, it is empty to discharge the corresponding memory of the texture Between, to this without limiting, those skilled in the art can be selected the present invention according to actual needs.
The release time is TRelease, in a kind of preferred embodiment, TRelease=Tmin
Wherein, TminFor at least time that preconfigured permission texture stops in memory, Tmin> 0.
In present embodiment, when the last time interval rendered apart from current time of the texture is more than permission line When managing at least time stopped in memory, then the texture is discharged.
In another preferred embodiment, TRelease=Tmin+NAdd in memory*TExtend
Wherein, TminAt least time stopped in memory for preconfigured permission texture.NAdd in memoryFor at current time The texture is loaded into the number in memory in a period of time T before.TExtendA memory is often added in for the texture to prolong Long release time.Tmin> 0.T > 0.TExtend> 0.
Difference lies in be also loaded into memory texture in present embodiment present embodiment with a upper embodiment Number accounts for, and texture resource is avoided back and forth to be loaded.By taking the icon in game as an example, an icon in certain scene is It is not just dodged after dodging 2 times, then if it exceeds the preconfigured at least time T that texture is allowed to stop in memoryminAfterwards, Its associated texture will be discharged from memory.But the comparison of another icon in Same Scene is more, it is assumed that 20 seconds average Left and right flicker is primary, then the texture resource is possible in one minute be loaded into memory for several times repeatedly, this illustrates the icon Although associated texture be not to show always, frequency of use is higher, has caused the repeated loading expense in one minute, Release time can be appropriately extended according to above-mentioned formula, be back and forth loaded into memory to avoid the texture.
In specific implementation, NAdd in memoryThe attribute for being used as the texture by the class for encapsulating a counter is calculated, When the texture is loaded into memory every time, the time that primary loading is completed is recorded, and works as the time that the loading is completed Recording distance current time is more than a period of time T, which will be cleaned out, and remaining record, which is counted, can obtain institute State NAdd in memory
It should be noted that for above-mentioned Tmin, T and TExtendConcrete numerical value, those skilled in the art can be according to practical need It is set, this is not limited by the present invention.
Game rendering intent provided in this embodiment, by being rendered in texture during when being that texture configuration renders Between stab, according to the time that texture the last time is rendered, when judging that the texture reaches release time, to described from memory Texture is discharged, and reduces occupied memory when game or running software.Resource management is not put up particularly with those Device and there are the game item of EMS memory occupation problems of too, the optimization that the present embodiment makes it is considerable.
It is the flow chart of another embodiment of game rendering intent provided by the invention with reference to Fig. 5.It is walked in the present embodiment Rapid S11~S18 is with consistent in embodiment illustrated in fig. 2, and details are not described herein, reference can be made to the associated description in embodiment illustrated in fig. 2. Difference lies in further comprise on the basis of the present embodiment embodiment shown in Fig. 2 for the present embodiment and embodiment illustrated in fig. 2 Step S19.
S19, after scene of game switching is carried out, the texture used in the first frame picture of scene of game after handover is added Carry display blank screen before completing.Alternatively, after scene of game switching is carried out, a period of time T after scene of game switchingBlank screenIt is interior Show blank screen.Wherein, TBlank screen> 0.
In game rendering intent provided by the invention, texture is loaded into according to the demand used in memory, although object May postpone zero can just be seen for several seconds by player, but as long as if the resource criterion of game, this interval fundamental sensation is not Out, several seconds objects of late zero are just drawn, and do not interfere with the experience of game completely.And when scene just switches, due to most Number texture is all not loaded into memory, and former frame pictures may only have a small number of objects to be rendered, and may generate in a flash The feeling of Hua Ping.Therefore, the present invention carries out specially treated when scene of game switches by step S19, is painted in present frame needs The texture picture of picture before not being loaded completely is drawn and shows blank screen nothing, is until required texture is loaded completion Only.Alternatively, when the rendering flow of certain projects is difficult to change, a period of time T that can directly after scene of game switchingBlank screen Interior display blank screen.TBlank screenConcrete numerical value can be set according to actual needs, this is not limited by the present invention, it is a kind of preferably Implementation in TBlank screenIt is 0.5 second.
It is the structure diagram of one embodiment of game rendering device provided by the invention referring to Fig. 6.The present embodiment Basic principle is consistent with the basic principle of embodiment illustrated in fig. 1, and part in the present embodiment is not described in detail and can be found in embodiment illustrated in fig. 1 In associated description.
The game rendering device, including:
Load path logging modle 11, for when game resource loads, recording adding for texture used in current game scene Carry path.
Grid acquisition module 12 to be rendered, for obtaining grid to be rendered in current game scene.
Detection module 13, for detecting whether the texture used in the grid to be rendered is loaded into memory.
Load-on module 14, for when the texture is not loaded, according to the load path of the texture, passing through backstage line Journey carries out the texture Asynchronous loading so that the texture is loaded into memory, and skips and the texture is criticized in current render Secondary rendering.With,
Rendering module 15, for when the texture being loaded completion, the texture being submitted to rendering engine and is carried out It renders.
It is the structure diagram of another embodiment of game rendering device provided by the invention referring to Fig. 7.The present embodiment It can be found in the associated description in embodiment illustrated in fig. 2 in place of not being described in detail corresponding to embodiment of the method shown in Fig. 2, in the present embodiment.
On the basis of game rendering device embodiment shown in Fig. 7 provided in this embodiment, further comprise timestamp Update module 16, timestamp acquisition module 17 and memory release module 18.
Update of time stamp module 16, for updating the render time of texture stamp.Wherein, the render time stamp is used for Record the time that described texture the last time is rendered.
Timestamp acquisition module 17, for every preset time interval, the institute traversed in memory to be textured, described in acquisition The render time stamp of texture.
The timestamp acquisition module 17 specifically includes texture scanning element 171, the first do-nothing operation unit 172 and memory and releases Put unit 173.
Texture scanning element 171, for every preset time interval, scanning the texture in memory one by one, described in judgement Whether texture is loaded completion.
First do-nothing operation unit 172, for when the texture is not loaded completion, skipping the texture.
Timestamp acquiring unit 173, for when the texture has been loaded completion, obtaining the render time of the texture Stamp.
Memory release module 18 for being stabbed according to the render time of the texture, judges that the texture reaches release time When, discharge the corresponding memory headroom of the texture.
The memory release module 18 specifically includes difference computational unit 181, the second do-nothing operation unit 182 and memory release Unit 183:
Difference computational unit 181, for calculating the difference of the render time stamp at current time and the texture.
Second do-nothing operation unit 182, for when the difference is less than release time, it is corresponding interior not discharge the texture Deposit space.
Memory releasing unit 183, for when the difference is more than release time, it is empty to discharge the corresponding memory of the texture Between.
In a kind of preferred embodiment, the release time is TRelease
TRelease=Tmin
Wherein, TminFor at least time that preconfigured permission texture stops in memory, Tmin> 0.
In another preferred embodiment, the release time is TRelease
TRelease=Tmin+NAdd in memory*TExtend
Wherein, TminAt least time stopped in memory for preconfigured permission texture.NAdd in memoryFor at current time The texture is loaded into the number in memory in a period of time T before.TExtendA memory is often added in for the texture to prolong Long release time.Tmin> 0.T > 0.TExtend> 0.
Though it is not drawn into figure, in specific implementation, to solve the problems, such as flower screen of the present invention when scene of game switches, The game rendering device can further include the first blank screen module or the second blank screen module.
The first blank screen module, for after scene of game switching is carried out, the first frame of scene of game after handover Texture used in picture is loaded display blank screen before completion.
The second blank screen module, for after scene of game switching is carried out, a period of time after scene of game switching TBlank screenInterior display blank screen.Wherein, TBlank screen> 0.
In conclusion game rendering intent provided in an embodiment of the present invention and device, when game resource loads, are skipped just Normal texture load phase only records the load path of texture, when detecting that the texture used in grid to be rendered is not loaded, Just the texture is loaded into memory by background thread, and passes through render time stamp record texture the last time quilt of texture The time of rendering periodically discharges the texture for reaching release time in memory, reduces occupied during game running Memory, advantageously account for low end machines running memory it is insufficient the problem of, help to improve the installation amount of game.
It should be noted that the apparatus embodiments described above are merely exemplary, wherein described be used as separating component The unit of explanation may or may not be physically separate, and the component shown as unit can be or can also It is not physical unit, you can be located at a place or can also be distributed in multiple network element.It can be according to reality It needs that some or all of module therein is selected to realize the purpose of this embodiment scheme.In addition, device provided by the invention In embodiment attached drawing, the connection relation between module represents there is communication connection between them, specifically can be implemented as one or A plurality of communication bus or signal wire.Those of ordinary skill in the art are without creative efforts, you can to understand And implement.
Through the above description of the embodiments, it is apparent to those skilled in the art that the present invention can borrow Help software that the mode of required common hardware is added to realize, naturally it is also possible to include application-specific integrated circuit, specially by specialized hardware It is realized with CPU, private memory, special components and parts etc..Under normal circumstances, all functions of being completed by computer program can It is easily realized with corresponding hardware, moreover, for realizing that the particular hardware structure of same function can also be a variety of more Sample, such as analog circuit, digital circuit or special circuit etc..But it is more for the purpose of the present invention in the case of software program it is real It is now more preferably embodiment.Based on such understanding, technical scheme of the present invention substantially in other words makes the prior art The part of contribution can be embodied in the form of software product, which is stored in the storage medium that can be read In, such as the floppy disk of computer, USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory Device (RAM, Random Access Memory), magnetic disc or CD etc., including some instructions with so that a computer is set Standby (can be personal computer, server or the network equipment etc.) performs the method described in each embodiment of the present invention.
The above description is merely a specific embodiment, but protection scope of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can readily occur in change or replacement, should all contain Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (16)

1. a kind of game rendering intent, which is characterized in that including:
When game resource loads, the load path of texture used in current game scene is recorded;
Obtain grid to be rendered in current game scene;
Detect whether the texture used in the grid to be rendered is loaded into memory;Wherein, the texture is not receiving It will not be loaded into memory before first time render request;
When the texture is not loaded, according to the load path of the texture, the texture is carried out by background thread different Step loading is skipped to the texture so that the texture is loaded into memory in the rendering for currently rendering batch;
When the texture has been loaded completion, the texture is submitted into rendering engine and is rendered.
2. as described in claim 1 game rendering intent, which is characterized in that it is described by the texture submit to rendering engine into After row renders, further include:
Update the render time stamp of the texture;Wherein, the render time stabs to record described texture the last time by wash with watercolours The time of dye.
3. game rendering intent as claimed in claim 2, which is characterized in that the game rendering intent further includes:
Every preset time interval, the institute traversed in memory is textured, obtains the render time stamp of the texture;
It is stabbed according to the render time of the texture, when judging that the texture reaches release time, it is corresponding interior to discharge the texture Deposit space.
4. game rendering intent as claimed in claim 3, which is characterized in that described every in preset time interval, traversal Institute in depositing is textured, obtains the render time stamp of the texture, specially:
Every preset time interval, the texture in memory is scanned one by one, judges whether the texture is loaded completion;
When the texture is not loaded completion, the texture is skipped;
When the texture has been loaded completion, the render time stamp of the texture is obtained.
5. game rendering intent as claimed in claim 4, which is characterized in that it is described to be stabbed according to the render time of the texture, When judging that the texture reaches release time, the corresponding memory headroom of the texture is discharged, specially:
Calculate the difference of the render time stamp of current time and the texture;
When the difference is less than release time, the corresponding memory headroom of the texture is not discharged;
When the difference is more than release time, the corresponding memory headroom of the texture is discharged.
6. game rendering intent as claimed in claim 5, which is characterized in that the release time is TRelease
TRelease=Tmin
Wherein, TminFor at least time that preconfigured permission texture stops in memory, Tmin> 0.
7. game rendering intent as claimed in claim 5, which is characterized in that the release time is TRelease
TRelease=Tmin+NAdd in memory*TExtend
Wherein, TminAt least time stopped in memory for preconfigured permission texture;NAdd in memoryFor before current time A period of time T in the texture be loaded into number in memory;TExtendFor the texture often adds in a memory and it is extended Release time;Tmin> 0;T > 0;TExtend> 0.
8. game rendering intent as described in any one of claim 1 to 7, which is characterized in that the game rendering intent also wraps It includes:
After scene of game switching is carried out, the texture used in the first frame picture of scene of game after handover, which is loaded, completes it Preceding display blank screen;
Alternatively,
After scene of game switching is carried out, a period of time T after scene of game switchingBlank screenInterior display blank screen;Wherein, TBlank screen> 0.
9. a kind of game rendering device, which is characterized in that including:
Load path logging modle, for when game resource loads, recording the load path of texture used in current game scene;
Grid acquisition module to be rendered, for obtaining grid to be rendered in current game scene;
Detection module, for detecting whether the texture used in the grid to be rendered is loaded into memory;Wherein, the line Reason will not be loaded into memory before first time render request is not received;
Load-on module, for when the texture is not loaded, according to the load path of the texture, by background thread to institute It states texture and carries out Asynchronous loading so that the texture is loaded into memory, and skip to the texture in the wash with watercolours for currently rendering batch Dye;With,
Rendering module, for when the texture being loaded completion, the texture being submitted to rendering engine and is rendered.
10. game rendering device as claimed in claim 9, which is characterized in that the game rendering device further includes:
Update of time stamp module, for updating the render time of texture stamp;Wherein, the render time stamp is for recording State the time that texture the last time is rendered.
11. game rendering device as claimed in claim 10, which is characterized in that the game rendering device further includes:
Timestamp acquisition module, for every preset time interval, the institute traversed in memory to be textured, obtains the texture Render time is stabbed;With,
Memory release module, for being stabbed according to the render time of the texture, when judging that the texture reaches release time, release The corresponding memory headroom of the texture.
12. game rendering device as claimed in claim 11, which is characterized in that the timestamp acquisition module includes:
Texture scanning element, for every preset time interval, scanning the texture in memory one by one, whether judging the texture It is loaded completion;
First do-nothing operation module, for when the texture is not loaded completion, skipping the texture;With,
Timestamp acquiring unit, for when the texture has been loaded completion, obtaining the render time of texture stamp.
13. game rendering device as claimed in claim 12, which is characterized in that the memory release module includes:
Difference computational unit, for calculating the difference of the render time stamp at current time and the texture;
Second do-nothing operation unit, for when the difference is less than release time, not discharging the corresponding memory headroom of the texture; With,
Memory releasing unit, for when the difference is more than release time, discharging the corresponding memory headroom of the texture.
14. game rendering device as claimed in claim 13, which is characterized in that the release time is TRelease
TRelease=Tmin
Wherein, TminFor at least time that preconfigured permission texture stops in memory, Tmin> 0.
15. game rendering device as claimed in claim 13, which is characterized in that the release time is TRelease
TRelease=Tmin+NAdd in memory*TExtend
Wherein, TminAt least time stopped in memory for preconfigured permission texture;NAdd in memoryFor before current time A period of time T in the texture be loaded into number in memory;TExtendFor the texture often adds in a memory and it is extended Release time;Tmin> 0;T > 0;TExtend> 0.
16. such as claim 9 to 15 any one of them game rendering device, which is characterized in that the game rendering device is also Including the first blank screen module or the second blank screen module;
The first blank screen module, for after scene of game switching is carried out, the first frame picture of scene of game after handover Texture used is loaded display blank screen before completion;
The second blank screen module, for after scene of game switching is carried out, a period of time T after scene of game switchingBlank screenIt is interior Show blank screen;Wherein, TBlank screen> 0.
CN201510499531.4A 2015-08-14 2015-08-14 A kind of game rendering intent and device Active CN105094920B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510499531.4A CN105094920B (en) 2015-08-14 2015-08-14 A kind of game rendering intent and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510499531.4A CN105094920B (en) 2015-08-14 2015-08-14 A kind of game rendering intent and device

Publications (2)

Publication Number Publication Date
CN105094920A CN105094920A (en) 2015-11-25
CN105094920B true CN105094920B (en) 2018-07-03

Family

ID=54575430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510499531.4A Active CN105094920B (en) 2015-08-14 2015-08-14 A kind of game rendering intent and device

Country Status (1)

Country Link
CN (1) CN105094920B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105678828B (en) * 2015-12-30 2020-03-31 合一网络技术(北京)有限公司 Method and device for creating transition animation
CN106412277B (en) * 2016-09-26 2018-11-06 腾讯科技(深圳)有限公司 The loading method and device of virtual scene
CN106547599B (en) * 2016-11-24 2020-05-05 腾讯科技(深圳)有限公司 Method and terminal for dynamically loading resources
CN108905212B (en) * 2017-03-27 2019-12-31 网易(杭州)网络有限公司 Game screen display control method and device, storage medium and electronic equipment
CN107450747B (en) 2017-07-25 2018-09-18 腾讯科技(深圳)有限公司 The displacement control method and device of virtual role
CN107507262B (en) * 2017-08-31 2021-03-16 城市生活(北京)资讯有限公司 Three-dimensional rendering method and system for large scene
CN108810554B (en) * 2018-06-15 2021-06-22 腾讯科技(深圳)有限公司 Scene image transmission method of virtual scene, computer device and storage medium
CN109828791B (en) * 2018-12-28 2022-03-22 北京奇艺世纪科技有限公司 Animation playing method, terminal and computer readable storage medium
CN109876446B (en) * 2019-01-14 2022-07-26 珠海金山网络游戏科技有限公司 Method and device for detecting occupation distribution of game map and grid in memory
CN110874856A (en) * 2019-11-12 2020-03-10 广州银汉科技有限公司 Optimization method for real-time rendering of GUI (graphical user interface) based on GPU (graphics processing Unit) characteristics
CN110941459A (en) * 2019-11-20 2020-03-31 东软集团股份有限公司 Method and device for calling Replugin
CN111773704B (en) * 2020-07-31 2024-02-23 网易(杭州)网络有限公司 Game data processing method and device, storage medium, processor and electronic device
CN112052097B (en) * 2020-10-15 2024-05-03 腾讯科技(深圳)有限公司 Virtual scene rendering resource processing method, device, equipment and storage medium
CN112370771A (en) * 2020-10-20 2021-02-19 广州西山居世游网络科技有限公司 Game running memory dynamic adjusting method and system
CN117670642A (en) * 2022-09-07 2024-03-08 象帝先计算技术(重庆)有限公司 Image rendering method, graphics processor, graphics processing system, device and equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2395411B (en) * 2000-01-28 2004-07-14 Namco Ltd Game system and image generation method
CN102323887A (en) * 2011-06-30 2012-01-18 中兴通讯股份有限公司 Browser engine-based method for dynamically loading Widget and mobile terminal
CN103455356A (en) * 2013-09-05 2013-12-18 中国计量学院 Concurrence loading and rendering method of 3D (three-dimensional) models on multi-core mobile device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102048885B1 (en) * 2013-05-09 2019-11-26 삼성전자 주식회사 Graphic processing unit, graphic processing system comprising the same, rendering method using the same

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2395411B (en) * 2000-01-28 2004-07-14 Namco Ltd Game system and image generation method
CN102323887A (en) * 2011-06-30 2012-01-18 中兴通讯股份有限公司 Browser engine-based method for dynamically loading Widget and mobile terminal
CN103455356A (en) * 2013-09-05 2013-12-18 中国计量学院 Concurrence loading and rendering method of 3D (three-dimensional) models on multi-core mobile device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
动态纹理载入的光线投射算法设计与实现;闫冰;《2010通信理论与技术新发展--第十五届全国青年通信学术会议伦文件(上册)》;20101231;第2010年卷;第72-77页 *

Also Published As

Publication number Publication date
CN105094920A (en) 2015-11-25

Similar Documents

Publication Publication Date Title
CN105094920B (en) A kind of game rendering intent and device
CN108595227A (en) Application program preloads method, apparatus, storage medium and mobile terminal
CN109794064A (en) Interact plot implementation method, device, terminal and storage medium
CN104602131A (en) Barrage processing method and system
CN106293803B (en) A kind of application control method and device
CN105718272B (en) A kind of method and terminal of terminal factory reset
EP4195149A1 (en) Target detection and tracking method and apparatus, electronic device, and storage medium
CN109344126B (en) Method and device for processing map, storage medium and electronic device
CN104035921B (en) A kind of information processing method and electronic equipment
CN110247796A (en) Monitoring alarm method, apparatus and relevant device
CN111459758B (en) Application information display method and device, electronic equipment and storage medium
CN113064677B (en) Application running method and device, storage medium and electronic device
CN107770046A (en) A kind of method and apparatus for picture mosaic
CN111953503A (en) NFV resource deployment arrangement method and network function virtualization orchestrator
CN106527891B (en) A kind of edit object selection method and relevant apparatus
CN104104878A (en) Reminding mthod and system for shooting time length in shooting process
CN107281754A (en) A kind of application identities matching process and its equipment, storage medium, server
CN106202374A (en) A kind of data processing method and device
CN106815038A (en) One kind application starts method and system
CN110166964A (en) A kind of determination method and device of base station to be expanded
CN108647059A (en) Application program prediction technique, device, storage medium and mobile terminal
CN115170390A (en) File stylization method, device, equipment and storage medium
CN107080946A (en) A kind of method and device of multiplayer resource allocation
CN106354809A (en) Picture deleting method and terminal equipment
CN108428002A (en) A kind of is to wait for the method and apparatus that restocking machine determines seat in the plane

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant