CN105094920A - Game rendering method and device - Google Patents

Game rendering method and device Download PDF

Info

Publication number
CN105094920A
CN105094920A CN201510499531.4A CN201510499531A CN105094920A CN 105094920 A CN105094920 A CN 105094920A CN 201510499531 A CN201510499531 A CN 201510499531A CN 105094920 A CN105094920 A CN 105094920A
Authority
CN
China
Prior art keywords
texture
time
game
internal memory
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.)
Granted
Application number
CN201510499531.4A
Other languages
Chinese (zh)
Other versions
CN105094920B (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 game rendering method and device. The game rendering method comprises the steps of recording a loading path of a texture used in a current game scene when game resources are loaded; obtaining a grid to be rendered in the current game scene; detecting whether a texture used by the grid to be rendered is loaded into a memory or not; when the texture is not loaded, conducting asynchronous loading on the texture through a background thread according to the loading path of the texture, so that the texture is loaded into the memory, and skipping the rendering of the texture for a current rendering batch; when the texture is loaded ready, submitting the texture to a rendering engine for conducting the rendering. According to the game rendering method and device, the texture rendering process is controlled, so that memory space occupied by the texture in the game operation process is greatly reduced.

Description

A kind of game rendering intent and device
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of game rendering intent and device.
Background technology
When game or running software, shared internal memory is the important indicator evaluating game or software quality.For game, in the process that computer or running of mobile terminal are played, the internal memory that game running takies is less, often can abdicate more resource, and other program that user is run simultaneously is run more smooth.China also exists a large amount of low-end mobile phones on the market, Ge great operator and mobile phone manufacturer often use very low hardware configuration to bring down prices, mobile phone EMS memory is less than normal, when the memory requirements of game running exceedes the maximum memory of mobile phone, game will be caused not run.Therefore, the internal memory reduced needed for game running can ensure that game can normally run thus obtain more customer group on more machine as far as possible.
At present, the optimal case reducing game running required memory does explorer, by explorer, unified management is carried out to the resource that will load, it is unified to explorer application resource when resource loads, explorer is carried out system analysis to resource by the situation of external reference, when finding resource not by any object reference, then according to certain strategy decision whether releasing resource, such as do not use strategy etc. at most.
Carry out unified management by explorer and obtain better effect undoubtedly, but when specific implementation, it is higher that the framework of explorer to program builds requirement.First, development of games must must use regular MVC framework, logical layer and the key-course of game forms must separate completely, and guarantee discharges the resources such as the texture picture of game when Objects hide and do not affect the data relevant to forms and logic function.In addition, for the module of some resource more complicated in game engine, such as unity forms UI module, after programmer is often difficult to determine forms release, whether some texture picture is also by other local use, must go to peel off resource and statistics resource information by writing special derivation plug-in unit.But, a lot of developers can not do this thing, or they just do not recognize the problem of committed memory at all, often arrive the later stage of project, all things all complete, the successful installation amount of operation platform feedback game is very low, or game test organization feedback game has various sudden strains of a muscle to move back problem in a lot of low end machines, and developer just goes to seek prioritization scheme.Now play and developed, framework is difficult to change, forms resource is because the dependence between module cannot discharge, be difficult to carry out internal memory optimization by explorer again, how to having developed or having carried out internal memory optimization close to the game completed or software, the EMS memory occupation reduced when it runs becomes the technical barrier of this area.
Summary of the invention
The object of the embodiment of the present invention there are provided a kind of game rendering intent and device, controls the render process of texture, memory headroom during reduction game running shared by texture.
To achieve these goals, embodiments provide a kind of game rendering intent, comprising:
When game resource loads, the load path of record current game scene texture used;
Obtain grid to be rendered in current game scene;
Whether the texture detecting described grid to be rendered used is loaded in internal memory;
When described texture is not loaded, according to the load path of described texture, by background thread, Asynchronous loading is carried out to be loaded in internal memory by described texture to described texture, and skip to described texture current to play up batch play up;
When described texture has been loaded, described texture is submitted to render engine and has played up.
Preferably, described texture submitted to after render engine plays up described, also comprises:
Upgrade the render time stamp of described texture; Wherein, described render time stamp is used for recording the described texture the last coloured time.
Further, described game rendering intent also comprises:
Every the time interval of presetting, all textures in traversal internal memory, obtain the render time stamp of described texture;
Render time according to described texture is stabbed, and when judging that described texture reaches release time, discharges the memory headroom that described texture is corresponding.
Wherein, in the described time interval every presetting, all textures in traversal internal memory, obtain the render time stamp of described texture, are specially:
Every the time interval of presetting, scan the texture in internal memory one by one, judge whether described texture has been loaded;
When described texture has not been loaded, skip described texture;
When described texture has been loaded, obtain the render time stamp of described texture.
The described stamp of the render time according to described texture, when judging that described texture reaches release time, discharges the memory headroom that described texture is corresponding, is specially:
Calculate the difference of the render time stamp of current time and described texture;
When described difference is less than release time, do not discharge the memory headroom that described texture is corresponding;
When described difference is greater than release time, discharge the memory headroom that described texture is corresponding.
One preferred embodiment in the middle of, described release time is T release;
T release=T min;
Wherein, T minfor at least time that pre-configured permission texture stops in internal memory, T min> 0.
In the middle of another preferred embodiment, described release time is T release;
T release=T min+ N add internal memory* T extend;
Wherein, T minfor at least time that pre-configured permission texture stops in internal memory; N add internal memoryfor in a period of time T before current time, described texture is loaded into the number of times in internal memory; T extendfor the release time that described texture often adds an internal memory and extend; T min> 0; T > 0; T extend> 0.
Further, described game rendering intent also comprises:
After carrying out scene of game switching, before the first frame picture of scene of game after handover texture used has been loaded, show blank screen;
Or,
After carrying out scene of game switching, a period of time T after scene of game switches blank screeninterior display blank screen; Wherein, T blank screen> 0.
The embodiment of the present invention additionally provides a kind of game rendering device, comprising:
Load path logging modle, for when game resource loads, the load path of record current game scene texture used;
Grid acquisition module to be rendered, for obtaining grid to be rendered in current game scene;
Whether detection module, be loaded in internal memory for the texture detecting described grid to be rendered used;
Load-on module, for when described texture is not loaded, according to the load path of described texture, carries out Asynchronous loading to be loaded in internal memory by described texture by background thread to described texture, and skip to described texture current to play up batch play up; With,
Rendering module, for when described texture has been loaded, has submitted to render engine by described texture and has played up.
Preferably, described game rendering device also comprises:
Update of time stamp module, for upgrading the render time stamp of described texture; Wherein, described render time stamp is used for recording the described texture the last coloured time.
Preferably, described game rendering device also comprises:
Timestamp acquisition module, for every the time interval of presetting, travels through all textures in internal memory, obtains the render time stamp of described texture; With,
Internal memory release module, stabs for the render time according to described texture, when judging that described texture reaches release time, discharges the memory headroom that described texture is corresponding.
Wherein, described timestamp acquisition module comprises:
Texture scanning element, for every the time interval of presetting, scans the texture in internal memory one by one, judges whether described texture has been loaded;
First blank operation module, for when described texture has not been loaded, has skipped described texture; With,
Timestamp acquiring unit, for when described texture has been loaded, has obtained the render time stamp of described texture.
Described internal memory release module comprises:
Difference computational unit, for calculating the difference of the render time stamp of current time and described texture;
Second blank operation unit, for when described difference is less than release time, does not discharge the memory headroom that described texture is corresponding; With,
Internal memory releasing unit, for when described difference is greater than release time, discharges the memory headroom that described texture is corresponding.
One preferred embodiment in the middle of, described release time is T release;
T release=T min;
Wherein, T minfor at least time that pre-configured permission texture stops in internal memory, T min> 0.
In the middle of another preferred embodiment, described release time is T release;
T release=T min+ N add internal memory* T extend;
Wherein, T minfor at least time that pre-configured permission texture stops in internal memory; N add internal memoryfor in a period of time T before current time, described texture is loaded into the number of times in internal memory; T extendfor the release time that described texture often adds an internal memory and extend; T min> 0; T > 0; T extend> 0.
Further, described game rendering device also comprises the first blank screen module or the second blank screen module;
Described first blank screen module, for after carrying out scene of game switching, shows blank screen before the first frame picture of scene of game after handover texture used has been loaded;
Described second blank screen module, for after carrying out scene of game switching, a period of time T after scene of game switches blank screeninterior display blank screen; Wherein, T blank screen> 0.
Existing game rendering intent, often when game resource loads by current game scene in may need use all textures be all loaded in internal memory, when needs are played up a certain texture, directly described texture is obtained again from internal memory, in game running, idle texture takies a large amount of memory headrooms.The present invention is when game resource loads, skip normal texture load phase, only record the load path of texture, when detecting that grid to be rendered texture used is not loaded, just be loaded in internal memory by background thread by described texture, texture, not receiving before first time plays up request, can not be loaded in the middle of internal memory, user demand according to texture loads texture, substantially reduces texture picture taking memory headroom.
Further, it is described texture configuration render time stamp in the process that the present invention plays up at texture, to record the described texture the last coloured time, when judging that described texture reaches release time, discharge the memory headroom that described texture is corresponding, the time of playing up according to texture the last time, texture resource idle in internal memory is discharged, internal memory shared when reducing game running, is conducive to the problem of the running memory deficiency solving low end machines.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of an embodiment of game rendering intent provided by the invention;
Fig. 2 is the process flow diagram of another embodiment of game rendering intent provided by the invention;
Fig. 3 is the process flow diagram of step S17 that provides of embodiment as shown in Figure 2;
Fig. 4 is the process flow diagram of step S18 that provides of embodiment as shown in Figure 2;
Fig. 5 is the process flow diagram of another embodiment of game rendering intent provided by the invention;
Fig. 6 is the structural representation of an embodiment of game rendering device provided by the invention;
Fig. 7 is the structural representation of another embodiment of game rendering device provided by the invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Sequence number in embodiment before each step, only for convenience of description, should not be considered as the restriction of the execution sequence to each step, in practical operation, the execution sequencing of each step may be different, although some step is ordinal relation in an embodiment, also may be coordination in practical operation, otherwise, although some step is coordination in an embodiment, also may be ordinal relation in practical operation.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
See Fig. 1, it is the process flow diagram of an embodiment of game rendering intent provided by the invention.
Described game rendering intent, comprises step S11 ~ S15:
S11, when game resource loads, the load path of record current game scene texture used.
Existing game rendering intent, general when game resource loads by current game scene in all textures (as the scenery in scene, role and UI etc.) of use may be needed all to be loaded in internal memory, when needs are played up a certain texture, directly described texture is obtained again from internal memory, but a lot of texture is not using in fact always, be loaded in internal memory, both added loading expense, too increased EMS memory occupation.Such as, certain monster in scene of game may not be occur at the very start, does not need to play up at the very start.Texture for this type can wait until that first time needs to load it when using again, and effectively can reduce EMS memory occupation and reduce to load expense.The present invention, when game resource loads, skips normal texture load phase, only records the load path of texture, with follow-up need to use described texture time, load according to described load path.
S12, obtains grid to be rendered in current game scene.
Described grid to be rendered is not coloured grid in current scene, in the middle of practical application, by all grids in traversal current scene, and judge whether described grid is not played up one by one, when described grid is not played up, be judged to be grid to be rendered by described not coloured grid.
S13, whether the texture detecting described grid to be rendered used is loaded in internal memory.In the middle of concrete enforcement, can play submit to grid play up play up request time, check whether the texture on the material ball corresponding with grid is loaded.
S14, when described texture is not loaded, according to the load path of described texture, carries out Asynchronous loading to be loaded in internal memory by described texture by background thread to described texture, and skips described texture at the current rendering step to play up batch.
S15, when described texture has been loaded, has submitted to render engine by described texture and has played up.
In the middle of concrete enforcement, described texture is except the state be not loaded and be loaded, also may be in the state be loaded, for improving loading efficiency and rendering efficiency, avoid game card to pause or interrupt, when described texture is loaded, skip present lot playing up this texture, that is: play up and only the texture loaded is played up for every batch, then playing up of present lot is directly skipped to the texture in loading, plays up for first after having been loaded by it and batch to play up; And for the texture not starting to load, then trigger the load step to this texture, also skip present lot playing up this texture simultaneously.。
The game rendering intent that the present embodiment provides, when game resource loads, skip normal texture load phase, only recording the load path of texture, when detecting that grid to be rendered texture used is not loaded, just by background thread, described texture being loaded in internal memory, texture do not receive first time play up request before, can not be loaded in the middle of internal memory, the user demand according to texture loads texture, substantially reduces texture picture taking memory headroom.
With reference to Fig. 2, it is the process flow diagram of another embodiment of game rendering intent provided by the invention.The present embodiment, on basis embodiment illustrated in fig. 1, comprises step S16 ~ S18 further.
S16, upgrades the render time stamp of described texture.Wherein, described render time stamp is used for recording the described texture the last coloured time.
In the middle of concrete enforcement, stab as the render time of described texture by adding time attribute in the class of described texture, if play more difficult change, texture obtains the class less than texture during when not loading, then by described texture bag one deck abstract class, be that described texture adds render time stamp in described abstract class.
It should be noted that, step S16 is arranged at the described embodiment described texture submitted to after render engine is played up although only give in Fig. 2, but it will be appreciated by those skilled in the art that, all can upgrade the render time stamp of described texture before and after each step that texture is played up, such as, can before needing described texture to be submitted to render engine at every turn and playing up, when receive need to described texture play up play up request time, namely the texture loader in project is found, the class of resource loader or texture, the render time stamp of described texture is upgraded.Also can be, after obtaining grid to be rendered in current game scene, namely upgrade the render time stamp of described grid to be rendered texture used.
S17, every the time interval of presetting, all textures in traversal internal memory, obtain the render time stamp of described texture.
As shown in Figure 3, in the middle of concrete enforcement, described step S17 draws together sub-step S171 ~ S173:
S171, every the time interval of presetting, scans the texture in internal memory one by one, judges whether described texture has been loaded.
S172, when described texture has not been loaded, has skipped described texture.
S173, when described texture has been loaded, has obtained the render time stamp of described texture.
The present invention periodically travels through all textures in internal memory, stress state according to texture operates accordingly to the carrying out of texture, the texture usually loaded is need to be submitted to the texture that render engine carries out playing up, therefore when texture has not also been loaded, for preventing the loading flow process interrupting texture, avoiding game card to pause or interrupting, described texture not operated, skip described texture, continue to scan next texture.And for the texture loaded, then according to the mark of described texture, read the time that its last time plays up.The mark of described texture can be ID or the title of described texture, also can be other marks arranged in addition for identifying described texture.
S18, the render time according to described texture is stabbed, and when judging that described texture reaches release time, discharges the memory headroom that described texture is corresponding.
A lot of texture resource in scene of game are not be in using state in fact always, certain monster such as in game has just no longer occurred after may occurring once, to submission no longer be needed to play up after the texture of then its correspondence, therefore after described texture is not played up and reached release time within a period of time, should discharge it, to avoid unnecessary EMS memory occupation.But, for the game window interfaces of relative complex, a window interfaces may contain various texture picture, and this texture picture often probably use by other window interfaces, if there is no detailed statistics, we are difficult to know that certain texture is current the need of playing up, and when closedown forms time, often can not determine which texture is unwanted.If add up accurately, then need the texture picture relied on forms when the related resource of loaded window to carry out record statistics, and need to revise one by one texture display code in a program, to upgrade these statistics.
It should be noted that, after although step S17 in the embodiment of the present invention ~ S18 seems and is arranged at step S16, but it will be appreciated by those skilled in the art that, step S17 ~ S18 is periodic flow process, and in the middle of concrete enforcement, step S11 ~ S16 and step S17 ~ S18 realizes playing up strategy to texture by non-interfering different threads and texture discharges tactful control respectively.
The time that the present embodiment was played up by render time stamp record texture the last time, according to render time stamp, the texture in internal memory being discharged, without the need to changing the original framework of game, reaching good internal memory optimization effect.
As shown in Figure 4, concrete implement when described in step S18 comprise sub-step S181 ~ S183:
S181, calculates the difference of the render time stamp of current time and described texture.
S182, when described difference is less than release time, does not discharge the memory headroom that described texture is corresponding.
S183, when described difference is greater than release time, discharges the memory headroom that described texture is corresponding.
Should be noted that, when described difference equals release time, both can process by situation about being less than, do not discharge the memory headroom that described texture is corresponding, also can process by situation about being greater than, discharge the memory headroom that described texture is corresponding, the present invention does not limit this, and those skilled in the art can select according to actual needs.
Described release time is T release, one preferred embodiment in the middle of, T release=T min.
Wherein, T minfor at least time that pre-configured permission texture stops in internal memory, T min> 0.
In present embodiment, when the last time of described texture play up distance current time interval greater than allow texture stop in internal memory at least time time, then described texture is discharged.
In the middle of another preferred embodiment, T release=T min+ N add internal memory* T extend.
Wherein, T minfor at least time that pre-configured permission texture stops in internal memory.N add internal memoryfor in a period of time T before current time, described texture is loaded into the number of times in internal memory.T extendfor the release time that described texture often adds an internal memory and extend.T min>0。T>0。T extend> 0.
The difference of present embodiment and a upper embodiment is, also considers the number of times that texture is loaded in internal memory in present embodiment, avoids texture resource back and forth to be loaded.For the icon in game, an icon in certain scene has not just dodged after being sudden strain of a muscle 2 times, if so exceed at least time T that pre-configured permission texture stops in internal memory minafter, its associated texture will discharge from internal memory.But another icon in Same Scene is many, suppose to glimmer once in average about 20 seconds, then this texture resource was just likely repeatedly loaded into several in internal memory in one minute, although this illustrates that the associated texture of this icon is not showing always, but frequency of utilization is higher, cause the repeated loading expense in a minute, proper extension can have been carried out according to above-mentioned formula to release time, be back and forth loaded in internal memory to avoid described texture.
In the middle of concrete enforcement, N add internal memorycalculated by the class that encapsulates the counter attribute as described texture, when described texture being loaded in internal memory at every turn, record the time once loaded, and the recording distance current time when the time that described loading completes exceedes a period of time T, this record by cleaned fall, statistics is carried out to remaining record and can obtain described N add internal memory.
It should be noted that for above-mentioned T min, T and T extendconcrete numerical value, those skilled in the art can set according to actual needs, and the present invention is not construed as limiting this.
The game rendering intent that the present embodiment provides, by being described texture configuration render time stamp in the process played up at texture, according to the texture the last coloured time, when judging that described texture reaches release time, from internal memory, described texture is discharged, shared internal memory when reducing game or running software.Especially do not put up explorer for those and there is the game item of EMS memory occupation problems of too, the optimization that the present embodiment is made it is considerable.
With reference to Fig. 5, it is the process flow diagram of another embodiment of game rendering intent provided by the invention.Step S11 in the present embodiment ~ S18 with embodiment illustrated in fig. 2 in consistent, do not repeat them here, can associated description in embodiment shown in Figure 2.The present embodiment and difference embodiment illustrated in fig. 2 are, the present embodiment further comprises step S19 on basis embodiment illustrated in fig. 2.
S19, after carrying out scene of game switching, shows blank screen before the first frame picture of scene of game after handover texture used has been loaded.Or, after carrying out scene of game switching, a period of time T after scene of game switches blank screeninterior display blank screen.Wherein, T blank screen> 0.
In game rendering intent provided by the invention, texture is loaded in internal memory according to the demand used, just can be seen by player although object may postpone several seconds zero point, as long as but the words of the resource criterion of game, this interval fundamental sensation is not out, evening, several seconds zero point, object just drew, and can not affect the experience of game completely.And when scene just switches, because most of texture is not all loaded in internal memory, former frame picture may only have minority object to be played up, the sensation of flower screen in a flash may be produced.Therefore, the present invention carries out special processing when scene of game switches by step S19, before the texture picture of present frame needs drawing is not loaded completely, do not draw display blank screen whatever, until required texture has been loaded.Or, some project play up flow process be difficult to change time, can directly scene of game switching after a period of time T blank screeninterior display blank screen.T blank screenconcrete numerical value can set according to actual needs, the present invention is not construed as limiting this, preferably implements central T in one blank screenit is 0.5 second.
See Fig. 6, it is the structural representation of an embodiment of game rendering device provided by the invention.The ultimate principle of the present embodiment is consistent with ultimate principle embodiment illustrated in fig. 1, and part is not described in detail in detail in the present embodiment can associated description in embodiment shown in Figure 1.
Described game rendering device, comprising:
Load path logging modle 11, for when game resource loads, the load path of record current game scene texture used.
Grid acquisition module 12 to be rendered, for obtaining grid to be rendered in current game scene.
Whether detection module 13, be loaded in internal memory for the texture detecting described grid to be rendered used.
Load-on module 14, for when described texture is not loaded, according to the load path of described texture, carries out Asynchronous loading to be loaded in internal memory by described texture by background thread to described texture, and skip to described texture current to play up batch play up.With,
Rendering module 15, for when described texture has been loaded, has submitted to render engine by described texture and has played up.
See Fig. 7, it is the structural representation of another embodiment of game rendering device provided by the invention.The present embodiment corresponds to embodiment of the method shown in Fig. 2, and part is not described in detail in detail in the present embodiment can associated description in embodiment shown in Figure 2.
The game rendering device that the present embodiment provides, on basis embodiment illustrated in fig. 7, further comprises update of time stamp module 16, timestamp acquisition module 17 and internal memory release module 18.
Update of time stamp module 16, for upgrading the render time stamp of described texture.Wherein, described render time stamp is used for recording the described texture the last coloured time.
Timestamp acquisition module 17, for every the time interval of presetting, travels through all textures in internal memory, obtains the render time stamp of described texture.
Described timestamp acquisition module 17 specifically comprises texture scanning element 171, first blank operation unit 172 and internal memory releasing unit 173.
Texture scanning element 171, for every the time interval of presetting, scans the texture in internal memory one by one, judges whether described texture has been loaded.
First blank operation unit 172, for when described texture has not been loaded, has skipped described texture.
Timestamp acquiring unit 173, for when described texture has been loaded, has obtained the render time stamp of described texture.
Internal memory release module 18, stabs for the render time according to described texture, when judging that described texture reaches release time, discharges the memory headroom that described texture is corresponding.
Described internal memory release module 18 specifically comprises difference computational unit 181, second blank operation unit 182 and internal memory releasing unit 183:
Difference computational unit 181, for calculating the difference of the render time stamp of current time and described texture.
Second blank operation unit 182, for when described difference is less than release time, does not discharge the memory headroom that described texture is corresponding.
Internal memory releasing unit 183, for when described difference is greater than release time, discharges the memory headroom that described texture is corresponding.
One preferred embodiment in the middle of, described release time is T release.
T release=T min.
Wherein, T minfor at least time that pre-configured permission texture stops in internal memory, T min> 0.
In the middle of another preferred embodiment, described release time is T release.
T release=T min+ N add internal memory* T extend.
Wherein, T minfor at least time that pre-configured permission texture stops in internal memory.N add internal memoryfor in a period of time T before current time, described texture is loaded into the number of times in internal memory.T extendfor the release time that described texture often adds an internal memory and extend.T min>0。T>0。T extend> 0.
Though do not draw in figure, in the middle of concrete enforcement, for solving the colored screen problem of the present invention when scene of game switches, described game rendering device can further include the first blank screen module or the second blank screen module.
Described first blank screen module, for after carrying out scene of game switching, shows blank screen before the first frame picture of scene of game after handover texture used has been loaded.
Described second blank screen module, for after carrying out scene of game switching, a period of time T after scene of game switches blank screeninterior display blank screen.Wherein, T blank screen> 0.
In sum, the game rendering intent that the embodiment of the present invention provides and device, when game resource loads, skip normal texture load phase, only record the load path of texture, when detecting that grid to be rendered texture used is not loaded, just by background thread, described texture is loaded in internal memory, and record the texture the last coloured time by the render time stamp of texture, periodically the texture reaching release time in internal memory is discharged, internal memory shared when reducing game running, be conducive to the problem of the running memory deficiency solving low end machines, contribute to the installation amount improving game.
It should be noted that, device embodiment described above is only schematic, the wherein said unit illustrated as separating component or can may not be and physically separates, parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of module wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.In addition, in device embodiment accompanying drawing provided by the invention, the annexation between module represents to have communication connection between them, specifically can be implemented as one or more communication bus or signal wire.Those of ordinary skill in the art, when not paying creative work, are namely appreciated that and implement.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add required common hardware by software and realize, and can certainly comprise special IC, dedicated cpu, private memory, special components and parts etc. realize by specialized hardware.Generally, all functions completed by computer program can realize with corresponding hardware easily, and the particular hardware structure being used for realizing same function also can be diversified, such as mimic channel, digital circuit or special circuit etc.But under more susceptible for the purpose of the present invention condition, software program realizes is better embodiment.Based on such understanding, technical scheme of the present invention can embody with the form of software product the part that prior art contributes in essence in other words, this computer software product is stored in the storage medium that can read, as the floppy disk of computing machine, USB flash disk, portable hard drive, ROM (read-only memory) (ROM, Read-OnlyMemory), random access memory (RAM, RandomAccessMemory), magnetic disc or CD etc., comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform method described in the present invention each embodiment.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; change can be expected easily or replace, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection domain of described claim.

Claims (16)

1. a game rendering intent, is characterized in that, comprising:
When game resource loads, the load path of record current game scene texture used;
Obtain grid to be rendered in current game scene;
Whether the texture detecting described grid to be rendered used is loaded in internal memory;
When described texture is not loaded, according to the load path of described texture, by background thread, Asynchronous loading is carried out to be loaded in internal memory by described texture to described texture, and skip to described texture current to play up batch play up;
When described texture has been loaded, described texture is submitted to render engine and has played up.
2. to play as claimed in claim 1 rendering intent, it is characterized in that, described texture submitted to after render engine plays up described, also comprise:
Upgrade the render time stamp of described texture; Wherein, described render time stamp is used for recording the described texture the last coloured time.
3. play as claimed in claim 2 rendering intent, it is characterized in that, described game rendering intent also comprises:
Every the time interval of presetting, all textures in traversal internal memory, obtain the render time stamp of described texture;
Render time according to described texture is stabbed, and when judging that described texture reaches release time, discharges the memory headroom that described texture is corresponding.
4. to play as claimed in claim 3 rendering intent, it is characterized in that, the described time interval every presetting, all textures in traversal internal memory, obtain the render time stamp of described texture, be specially:
Every the time interval of presetting, scan the texture in internal memory one by one, judge whether described texture has been loaded;
When described texture has not been loaded, skip described texture;
When described texture has been loaded, obtain the render time stamp of described texture.
5. to play as claimed in claim 4 rendering intent, it is characterized in that, the described stamp of the render time according to described texture, when judging that described texture reaches release time, discharges the memory headroom that described texture is corresponding, is specially:
Calculate the difference of the render time stamp of current time and described texture;
When described difference is less than release time, do not discharge the memory headroom that described texture is corresponding;
When described difference is greater than release time, discharge the memory headroom that described texture is corresponding.
6. play as claimed in claim 5 rendering intent, it is characterized in that, described release time is T release;
T release=T min;
Wherein, T minfor at least time that pre-configured permission texture stops in internal memory, T min> 0.
7. play as claimed in claim 5 rendering intent, it is characterized in that, described release time is T release;
T release=T min+ N add internal memory* T extend;
Wherein, T minfor at least time that pre-configured permission texture stops in internal memory; N add internal memoryfor in a period of time T before current time, described texture is loaded into the number of times in internal memory; T extendfor the release time that described texture often adds an internal memory and extend; T min> 0; T > 0; T extend> 0.
8. the game rendering intent as described in any one of claim 1 to 7, is characterized in that, described game rendering intent also comprises:
After carrying out scene of game switching, before the first frame picture of scene of game after handover texture used has been loaded, show blank screen;
Or,
After carrying out scene of game switching, a period of time T after scene of game switches blank screeninterior display blank screen; Wherein, T blank screen> 0.
9. a game rendering device, is characterized in that, comprising:
Load path logging modle, for when game resource loads, the load path of record current game scene texture used;
Grid acquisition module to be rendered, for obtaining grid to be rendered in current game scene;
Whether detection module, be loaded in internal memory for the texture detecting described grid to be rendered used;
Load-on module, for when described texture is not loaded, according to the load path of described texture, carries out Asynchronous loading to be loaded in internal memory by described texture by background thread to described texture, and skip to described texture current to play up batch play up; With,
Rendering module, for when described texture has been loaded, has submitted to render engine by described texture and has played up.
10. play as claimed in claim 9 rendering device, it is characterized in that, described game rendering device also comprises:
Update of time stamp module, for upgrading the render time stamp of described texture; Wherein, described render time stamp is used for recording the described texture the last coloured time.
11. play rendering device as claimed in claim 10, and it is characterized in that, described game rendering device also comprises:
Timestamp acquisition module, for every the time interval of presetting, travels through all textures in internal memory, obtains the render time stamp of described texture; With,
Internal memory release module, stabs for the render time according to described texture, when judging that described texture reaches release time, discharges the memory headroom that described texture is corresponding.
12. play rendering device as claimed in claim 11, and it is characterized in that, described timestamp acquisition module comprises:
Texture scanning element, for every the time interval of presetting, scans the texture in internal memory one by one, judges whether described texture has been loaded;
First blank operation module, for when described texture has not been loaded, has skipped described texture; With,
Timestamp acquiring unit, for when described texture has been loaded, has obtained the render time stamp of described texture.
13. play rendering device as claimed in claim 12, and it is characterized in that, described internal memory release module comprises:
Difference computational unit, for calculating the difference of the render time stamp of current time and described texture;
Second blank operation unit, for when described difference is less than release time, does not discharge the memory headroom that described texture is corresponding; With,
Internal memory releasing unit, for when described difference is greater than release time, discharges the memory headroom that described texture is corresponding.
14. play rendering device as claimed in claim 13, and it is characterized in that, described release time is T release;
T release=T min;
Wherein, T minfor at least time that pre-configured permission texture stops in internal memory, T min> 0.
15. play rendering device as claimed in claim 13, and it is characterized in that, described release time is T release;
T release=T min+ N add internal memory* T extend;
Wherein, T minfor at least time that pre-configured permission texture stops in internal memory; N add internal memoryfor in a period of time T before current time, described texture is loaded into the number of times in internal memory; T extendfor the release time that described texture often adds an internal memory and extend; T min> 0; T > 0; T extend> 0.
16. game rendering devices as described in any one of claim 9 to 15, it is characterized in that, described game rendering device also comprises the first blank screen module or the second blank screen module;
Described first blank screen module, for after carrying out scene of game switching, shows blank screen before the first frame picture of scene of game after handover texture used has been loaded;
Described second blank screen module, for after carrying out scene of game switching, a period of time T after scene of game switches blank screeninterior display blank screen; Wherein, T blank 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 true CN105094920A (en) 2015-11-25
CN105094920B 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)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105678828A (en) * 2015-12-30 2016-06-15 合一网络技术(北京)有限公司 Method and apparatus for creating transition animations
CN106412277A (en) * 2016-09-26 2017-02-15 腾讯科技(深圳)有限公司 Method and apparatus for loading virtual scene
CN106547599A (en) * 2016-11-24 2017-03-29 腾讯科技(深圳)有限公司 A kind of method and terminal of resource dynamic load
CN106975219A (en) * 2017-03-27 2017-07-25 网易(杭州)网络有限公司 Display control method and device, storage medium, the electronic equipment of game picture
CN107450747A (en) * 2017-07-25 2017-12-08 腾讯科技(深圳)有限公司 The displacement control method and device of virtual role
CN107507262A (en) * 2017-08-31 2017-12-22 城市生活(北京)资讯有限公司 A kind of three-dimensional rendering method and system of large scene
CN108810554A (en) * 2018-06-15 2018-11-13 腾讯科技(深圳)有限公司 Scene image transmission method, computer equipment and the storage medium of virtual scene
CN109828791A (en) * 2018-12-28 2019-05-31 北京奇艺世纪科技有限公司 A kind of animation playing method, terminal and computer readable storage medium
CN109876446A (en) * 2019-01-14 2019-06-14 珠海金山网络游戏科技有限公司 A kind of method and apparatus for detecting game textures and grid and occupying distribution 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
CN111773704A (en) * 2020-07-31 2020-10-16 网易(杭州)网络有限公司 Game data processing method, game data processing device, storage medium, processor and electronic device
CN112052097A (en) * 2020-10-15 2020-12-08 腾讯科技(深圳)有限公司 Rendering resource processing method, device and equipment for virtual scene 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 (4)

* 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
US20140333620A1 (en) * 2013-05-09 2014-11-13 Yong-Ha Park Graphic processing unit, graphic processing system including the same and rendering method using the same

Patent Citations (4)

* 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
US20140333620A1 (en) * 2013-05-09 2014-11-13 Yong-Ha Park Graphic processing unit, graphic processing system including the same and rendering method using the same
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通信理论与技术新发展--第十五届全国青年通信学术会议伦文件(上册)》 *

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105678828A (en) * 2015-12-30 2016-06-15 合一网络技术(北京)有限公司 Method and apparatus for creating transition animations
CN105678828B (en) * 2015-12-30 2020-03-31 合一网络技术(北京)有限公司 Method and device for creating transition animation
CN106412277A (en) * 2016-09-26 2017-02-15 腾讯科技(深圳)有限公司 Method and apparatus for loading virtual scene
CN106547599A (en) * 2016-11-24 2017-03-29 腾讯科技(深圳)有限公司 A kind of method and terminal of resource dynamic load
CN106975219A (en) * 2017-03-27 2017-07-25 网易(杭州)网络有限公司 Display control method and device, storage medium, the electronic equipment of game picture
CN107450747B (en) * 2017-07-25 2018-09-18 腾讯科技(深圳)有限公司 The displacement control method and device of virtual role
WO2019019968A1 (en) * 2017-07-25 2019-01-31 腾讯科技(深圳)有限公司 Displacement control method and device for virtual character, and storage medium
US12026847B2 (en) 2017-07-25 2024-07-02 Tencent Technology (Shenzhen) Company Limited Method and apparatus for controlling placement of virtual character and storage medium
CN107450747A (en) * 2017-07-25 2017-12-08 腾讯科技(深圳)有限公司 The displacement control method and device of virtual role
US11527052B2 (en) 2017-07-25 2022-12-13 Tencent Technology (Shenzhen) Company Limited Method and apparatus for controlling placement of virtual character and storage medium
US11049329B2 (en) 2017-07-25 2021-06-29 Tencent Technology (Shenzhen) Company Limited Method and apparatus for controlling placement of virtual character and storage medium
CN107507262B (en) * 2017-08-31 2021-03-16 城市生活(北京)资讯有限公司 Three-dimensional rendering method and system for large scene
CN107507262A (en) * 2017-08-31 2017-12-22 城市生活(北京)资讯有限公司 A kind of three-dimensional rendering method and system of large scene
CN108810554A (en) * 2018-06-15 2018-11-13 腾讯科技(深圳)有限公司 Scene image transmission method, computer equipment and the storage medium of virtual scene
CN109828791A (en) * 2018-12-28 2019-05-31 北京奇艺世纪科技有限公司 A kind of animation playing method, terminal and computer readable storage medium
CN109828791B (en) * 2018-12-28 2022-03-22 北京奇艺世纪科技有限公司 Animation playing method, terminal and computer readable storage medium
CN109876446A (en) * 2019-01-14 2019-06-14 珠海金山网络游戏科技有限公司 A kind of method and apparatus for detecting game textures and grid and occupying distribution 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
CN111773704A (en) * 2020-07-31 2020-10-16 网易(杭州)网络有限公司 Game data processing method, game data processing device, storage medium, processor and electronic device
CN111773704B (en) * 2020-07-31 2024-02-23 网易(杭州)网络有限公司 Game data processing method and device, storage medium, processor and electronic device
CN112052097A (en) * 2020-10-15 2020-12-08 腾讯科技(深圳)有限公司 Rendering resource processing method, device and equipment for virtual scene and storage medium
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

Also Published As

Publication number Publication date
CN105094920B (en) 2018-07-03

Similar Documents

Publication Publication Date Title
CN105094920A (en) Game rendering method and device
CN111061484B (en) Code compiling method, device, server, user terminal and readable medium
CN104424092A (en) Page loading time length testing method and device
CN107807847B (en) Application process management method and terminal equipment
CN103530220A (en) Display method and system and terminal for application program icons
CN102523475B (en) Testing method and device for electronic products, and television set
US9092573B2 (en) System, method, and computer program product for testing device parameters
CN112473144A (en) Game resource data processing method and device
CN106326120B (en) Regression testing method and device for application software and electronic equipment
CN110427256A (en) Job scheduling optimization method, equipment, storage medium and device priority-based
CN109189486B (en) Display screen driver loading method and device, terminal and storage medium
CN107247550A (en) One kind application switching method and device, computer installation, readable storage medium storing program for executing
CN110362460A (en) A kind of application program capacity data processing method, device and storage medium
CN110968508B (en) Method, device, terminal and storage medium for determining loading time of applet
CN112214405A (en) Software testing method and device, electronic equipment and readable storage medium
CN109582382B (en) Loading method and device of configuration information, storage medium and terminal equipment
CN110377408A (en) A kind of starting method, apparatus, terminal and the medium of application program
CN111953503A (en) NFV resource deployment arrangement method and network function virtualization orchestrator
EP4036716A1 (en) Method and device for acquiring mirror image file
CN103257897B (en) Starting method and device of mobile terminal browser and mobile terminal
CN111385661B (en) Method, device, terminal and storage medium for voice control of full screen playing
CN115858114A (en) Scheduling method and device of idle task, electronic equipment and readable storage medium
CN110874222A (en) Template deployment method and device of smart television and server
CN112235628B (en) Multi-window opening method, device, equipment and medium for television operating system
CN115237441A (en) Upgrade test method, device and medium based on cloud platform

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