WO2019015591A1 - 游戏渲染方法、游戏资源文件的生成方法、装置及设备 - Google Patents

游戏渲染方法、游戏资源文件的生成方法、装置及设备 Download PDF

Info

Publication number
WO2019015591A1
WO2019015591A1 PCT/CN2018/096002 CN2018096002W WO2019015591A1 WO 2019015591 A1 WO2019015591 A1 WO 2019015591A1 CN 2018096002 W CN2018096002 W CN 2018096002W WO 2019015591 A1 WO2019015591 A1 WO 2019015591A1
Authority
WO
WIPO (PCT)
Prior art keywords
texture
game
shredded
texture map
rendering
Prior art date
Application number
PCT/CN2018/096002
Other languages
English (en)
French (fr)
Inventor
徐敏君
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to KR1020207004663A priority Critical patent/KR102419745B1/ko
Priority to EP18834397.4A priority patent/EP3657327B1/en
Priority to JP2020502688A priority patent/JP6901623B2/ja
Publication of WO2019015591A1 publication Critical patent/WO2019015591A1/zh
Priority to US16/745,079 priority patent/US11344806B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/20Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterised by details of the game platform
    • A63F2300/203Image generating hardware
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images

Definitions

  • the present invention relates to the field of Internet technologies, and in particular to the field of Internet game technologies, and in particular, to a game rendering method, a method for generating a game resource file, a game rendering device, a device for generating a game resource file, and a storage device. And a terminal.
  • the traditional game rendering method generally preloads all the texture maps (such as scenes, characters, and UI (User Interface)) that may be needed in the current running scene of the game into the memory, when needed When the texture map is rendered, the texture map is directly obtained from the memory.
  • texture maps such as scenes, characters, and UI (User Interface)
  • UI User Interface
  • Many texture maps are not always used, and are loaded into the memory, which increases the loading overhead and increases the memory usage, thereby causing the game to be stuck.
  • Another game rendering method has appeared in the prior art, which can reduce the memory burden to some extent.
  • the texture merging tool texture packer is used to merge multiple small texture maps into one large texture map.
  • the large texture map needs to be loaded into memory when rendering multiple game elements (such as scenes, characters, etc.), saving some loading overhead; when rendering multiple game elements, as long as these elements use the same large texture map , and the rendering parameters are consistent, you can merge the rendering batch to improve rendering performance.
  • the method of using the texture merging tool can improve the rendering performance, it needs to load the entire large texture map into the memory at the same time. Since the game runs with a lot of texture multiplexing, this way also causes a lot of unnecessary memory overhead. And as the game version is updated and the content is increased, the memory burden is significantly increased, which in turn causes the game to be stuck.
  • the embodiment of the present invention provides a game rendering method, a method, a device, a storage device, and a terminal for generating a game resource file, which can ensure the rendering effect of the screen and avoid the linear increase of the memory load with the game running, thereby ensuring smooth running of the game.
  • the embodiment of the present application provides a game rendering method, which may include:
  • the resource file includes at least one texture map required for game rendering, wherein one piece of the texture map is formed by combining multiple pieces of broken texture;
  • the method before the acquiring the resource file of the game, the method further includes:
  • the shredded texture includes a shredded texture data and edge original texture data surrounding a preset width of the shredded texture data;
  • the shredded texture corresponding to each texture map is encapsulated into the resource file.
  • the fragmentation processing each texture map into multiple pieces of fragmented texture respectively includes:
  • the original texture data included in the selected texture map is shredded according to the second preset specification to obtain a plurality of fragmented texture data, and the edge original texture data of the preset width is obtained around each of the fragmented texture data;
  • the value of the first preset specification is greater than or equal to the sum of the value of the second preset specification and the value of twice the preset width.
  • the plurality of fragmented texture data and the preset width edge original texture data are filled to the corresponding rectangular frame, and the completed filled rectangular frame forms a fragmented texture, including:
  • each rectangular frame Preserving the edge of the preset width on each of the upper and lower sides of each rectangular frame, and adding the edge of the preset width to each of the left and right sides of each rectangular frame, so that each rectangular frame has a central area and an edge area surrounding the central area;
  • the encapsulating the shredded texture corresponding to each texture map into the resource file comprises:
  • attributes of each texture map where the attributes include an ID (Identity), a release type, and offset information, and the release type includes immediate release, automatic release, or resident memory;
  • the summary information table is stored in a file header of the resource file, and the fragmented texture corresponding to each texture map is stored in a file body of the resource file.
  • the merging and rendering of the shredded texture corresponding to the target texture map comprises:
  • the preset dynamic loading area in the memory is cut to form a plurality of dynamic loading lines
  • the loaded shredded texture is read from the dynamically loaded row and submitted to the game's rendering engine for rendering.
  • the method further includes:
  • the reclaimed dynamic load rows are merged.
  • the embodiment of the present application provides a method for generating a game resource file, which may include:
  • the shredded texture corresponding to each texture map is encapsulated into a resource file of the game.
  • an embodiment of the present application provides a game rendering apparatus, which may include:
  • a file obtaining unit configured to acquire a resource file of the game, where the resource file includes at least one texture map required for game rendering, wherein one piece of the texture map is formed by combining multiple pieces of broken texture;
  • a target determining unit configured to determine a target texture map used by the grid to be rendered in the current running scene of the game
  • a searching unit configured to search, from the resource file, a fragmented texture corresponding to the target texture map
  • a merging rendering unit configured to perform merging and rendering the shredded texture corresponding to the target texture map.
  • the game rendering device further includes:
  • a resource packing processing unit configured to acquire at least one texture map required for the rendering of the game, the texture map includes original texture data, and each texture texture is shredded into multiple pieces of fragmented texture, and a fragmented texture includes a shredded texture data and edge raw texture data surrounding a preset width of the shredded texture data, and encapsulating a plurality of pieces of shredded texture corresponding to each texture map into the resource file;
  • a recycling processing unit configured to acquire a release type of the target texture map from a file header of the resource file, and release a dynamic loading line occupied by each fragmented texture of the target texture map according to the acquired release type, And merging the reclaimed dynamic load rows.
  • the resource packing processing unit is specifically configured to: sequentially select each texture map, and cut the selected texture map according to the first preset specification to obtain a plurality of rectangular frames; and the original texture included in the selected texture map
  • the data is shredded according to the second preset specification to obtain a plurality of shredded texture data, and the edge original texture data of the preset width is obtained around each of the shredded texture data; and the plurality of shredded texture data and the preset width are
  • the edge original texture data is filled to the corresponding rectangular frame, and a filled rectangular frame forms a fragmented texture; wherein the value of the first preset specification is greater than or equal to the value of the second preset specification and the value of twice the preset width sum;
  • the plurality of shredded texture data and the edge original texture data of the preset width are filled into the corresponding rectangular frame, and the completed rectangular frame forms a shredded texture, including: presetting each of the upper and lower sides of each rectangular frame The edge of the width, and the edge of the preset width is added to the left and right sides of each rectangular frame, so that each rectangular frame has a central area and an edge area surrounding the central area; and the plurality of fragmented texture data are respectively filled to the corresponding rectangular frame a central area, and the edge original texture data surrounding the preset width of each fragmented texture data is respectively filled into the edge area of the corresponding rectangular frame, and a filled rectangular frame forms a fragmented texture;
  • the resource packing processing unit is specifically configured to: acquire attributes of each texture map, where the attributes include an ID, a release type, and offset information, where the release type includes immediate release, automatic release, or resident, according to each texture map.
  • the attribute generates a summary information table, and stores the summary information table in a file header of the resource file, and stores the plurality of pieces of fragmented texture corresponding to each texture map to a file body of the resource file.
  • the merge rendering unit is specifically configured to: cut a preset dynamic loading area in a memory according to a first preset specification to form a plurality of dynamic loading lines; and use a boxing algorithm to idle the dynamic loading line.
  • the area is allocated; the pieces of shredded texture corresponding to the target texture map are sequentially loaded into the free area of the dynamic loading line; and the loaded shredded texture is read from the dynamic loading line and submitted to the game
  • the rendering engine is rendered.
  • the embodiment of the present application provides a device for generating a game resource file, which may include:
  • a texture obtaining unit configured to acquire at least one texture map required for game rendering, the texture map containing original texture data
  • a fragmentation processing unit configured to respectively process each texture map into a plurality of fragmented textures
  • a file encapsulating unit configured to encapsulate the shredded texture corresponding to each texture map into a resource file of the game.
  • the embodiment of the present application further provides a storage device, where the storage device stores one or more instructions, and the one or more instructions are adapted to be loaded by a processor and execute the game described in the embodiment of the present application.
  • the embodiment of the present application further provides a terminal, where the terminal includes:
  • a processor adapted to implement one or more instructions
  • the storage device storing one or more instructions, the one or more instructions being adapted to be loaded by the processor and executing the game rendering method described in the embodiments of the present application, or The method of generating game resource files.
  • the texture map is shredded into multiple pieces of shredded texture in the resource packaging process, and the shredding texture corresponding to the target texture map used in the game rendering needs to be loaded, which can effectively reduce the memory loading overhead and reduce the memory load.
  • the combined texture rendering of the shredded texture corresponding to the target texture map can ensure the rendering of the screen effect, avoiding the linear increase of the memory load with the game running, thereby ensuring smooth running of the game.
  • FIG. 1 is a flowchart of a game rendering method according to an embodiment of the present application
  • FIG. 2 is a flowchart of a method for generating a game resource file according to an embodiment of the present application
  • 3a-3c are schematic diagrams of a shredding process provided by an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a screen effect of a merge rendering according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of a game rendering apparatus according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • Game rendering refers to a series of processing processes of computer drawing scenes of a game, including spatial illumination calculation, rasterization and cropping, texture sampling, depth detection, and transparent blending. Game rendering requires the use of various resources, including animations, texture maps, and more.
  • the texture map refers to the texture file used in the running scene of the game, which can make the scene picture of the game more realistic; the texture map has various types of formats, and also has various application scenarios, for example: there is posted in 3D ( 3 Dimension, 3D) 3D texture maps on models or for spatial UI interactions, 2D texture maps attached to 2D planes or for flat UI interactions. Texture sampling is generally divided into nearest point sampling and linear sampling.
  • the nearest point sampling is to sample the original texture data contained in the texture map according to the pixel coordinates of the texture map, to find the closest original texture data, and use the pixel of the closest original texture data.
  • linear sampling is to continue sampling a plurality of data near the original texture data and calculate a pixel average value of each sampled data after finding the closest original texture data, and determine the average value of the pixel as The color value of the texture map.
  • resources such as texture maps used in game rendering are made by art during game development.
  • the original resources produced cannot be directly used in the game application, but need to undergo some processing, including binary. , encryption and compression, these processes are called resource packaging process, the obtained file is the game's resource file, the resource file contains the animation, texture map and other resources required for game rendering, and the resources in the resource file Can be applied directly to the game.
  • the traditional game rendering method generally preloads all texture textures (such as scenes, characters, and UIs) that may be needed in the current running scene of the game into memory.
  • texture textures such as scenes, characters, and UIs
  • the texture map is obtained directly in memory.
  • many texture maps are not always used. For example, some weapon in the scene may not appear at the beginning, and it does not need to be rendered at the beginning, and it is loaded into the memory. Increased loading overhead, also increased memory usage, which in turn caused the game to get stuck.
  • Another game rendering method has appeared in the prior art, which can reduce the memory burden to some extent. This method uses a texture merging tool (such as a texture packer tool) to merge multiple small texture maps using a texture packer during resource packaging.
  • the large texture map is loaded into memory when rendering multiple game elements (such as scenes, characters, etc.), saving some loading overhead; when rendering multiple game elements, these
  • the elements use the same large texture map, and the rendering parameters are consistent to blend the render batch to improve rendering performance.
  • the method of using the texture merging tool can improve the rendering performance, it needs to load the entire large texture map into the memory at the same time. Since the game runs with a lot of texture multiplexing, this way also causes a lot of unnecessary memory overhead. And as the game version is updated and the content is increased, the memory burden is significantly increased, which in turn causes the game to be stuck.
  • the texture map is shredded into multiple pieces of shredded texture in the resource packaging process, and the shredding texture corresponding to the target texture map used in the game rendering needs to be loaded, which can effectively reduce the memory loading overhead and reduce the memory load.
  • the combined texture rendering of the shredded texture corresponding to the target texture map can ensure the rendering of the screen effect, avoiding the linear increase of the memory load with the game running, thereby ensuring smooth running of the game.
  • the embodiment of the present application provides a game rendering method.
  • the game rendering method can be applied to a terminal on a user side, such as a mobile phone, a tablet computer, a PC (Personal Computer, a personal computer), and the like.
  • the game rendering method may include the following steps S101-S104.
  • the game resource file is a file formed by the resource packaging process, including but not limited to one or more texture maps required for game rendering, and may also include some animation resources required for game rendering;
  • the texture map in the resource file is not a traditional whole texture map, but a combination of multiple pieces of broken texture stitching.
  • the game resource file is stored in the storage space of the terminal where the game is located, for example, the resource file of the computer game is stored in the storage space allocated by the computer for the game; or the resource file of the mobile game is stored in the mobile phone for the game. In the storage space; then, the game resource file can be obtained from the storage space of the terminal where the game is located.
  • the game usually uses a grid to render elements related to the area. For example, if an area of a game scene needs to present a map, the map element can be rendered based on the grid. Common meshes include square meshes, hexagonal meshes, triangular meshes, and more.
  • a game scene image usually contains multiple grids. Currently, you need to render an element (such as a character, a scene, etc.) in a grid. You need to render the grid. In this case, the grid is the network to be rendered. grid. The mesh in the scene picture of the game and the texture map used are determined before the game is rendered.
  • the target texture map used can be determined according to the current running scene of the game and the grid to be rendered.
  • the target texture map in the resource file is not a whole texture map, but is composed of multiple pieces of broken texture stitching; then, when determining that the target texture map needs to be rendered currently, the target texture map can be found from the resource file. Corresponding multiple pieces of shredded texture.
  • S104 Perform combined rendering on the shredded texture corresponding to the target texture map.
  • the process of merging the rendering may include: first loading the multiple pieces of the shredded texture of the target texture map into the memory, and submitting to the game rendering engine for rendering after the loading is completed.
  • the rendered image effect obtained by combining and rendering multiple shredded textures is exactly the same as the rendered image effect obtained by rendering the entire target texture map, but the memory and memory pressure are significantly reduced, and the rendering performance is obtained. Effective improvement.
  • the texture map is shredded into multiple pieces of shredded texture in the resource packaging process, and the shredding texture corresponding to the target texture map used in the game rendering needs to be loaded, which can effectively reduce the memory loading overhead and reduce the memory load.
  • the combined texture rendering of the shredded texture corresponding to the target texture map can ensure the rendering of the screen effect, avoiding the linear increase of the memory load with the game running, thereby ensuring smooth running of the game.
  • the embodiment of the present application further provides a method for generating a game resource file.
  • the method for generating the game resource file can be applied to a terminal used by a game development designer, such as a PC.
  • the method for generating the game resource file may include the following steps S201-S210.
  • Steps S201-S203 belong to the resource packaging process. All texture textures required for rendering the game by the art production game during game development, these texture maps exist in the form of original texture data, and in the process of resource packaging, the texture data of the texture map is performed. Shredding, a texture map can be broken into multiple pieces of shredded textures that are encapsulated into resource files for use in game rendering.
  • the piece of shredded texture includes a shredded texture data and edge original texture data surrounding the preset width of the shredded texture data
  • the shredding process in step S202 may specifically include the following steps s11-s13:
  • the original texture data included in the selected texture map is shredded according to the second preset specification to obtain a plurality of fragmented texture data, and the edge original texture data of the preset width is obtained around each of the fragmented texture data;
  • the step s13 may include the following steps: first, pre-set the edge of the preset width on each of the upper and lower sides of each rectangular frame, and add the edge of the preset width to each of the left and right sides of each rectangular frame, so that each The rectangular frame has a central area and an edge area surrounding the central area; secondly, a plurality of fragmented texture data are respectively filled into the central area of the corresponding rectangular frame, and the edge original texture data of the preset width surrounding each of the fragmented texture data is respectively Filled into the edge area of the corresponding rectangle, a filled rectangle forms a shredded texture.
  • Each texture map repeats the above steps s11-s13 for shredding, and all texture maps are broken into multiple pieces of shredded texture.
  • the value of the first preset specification is greater than or equal to the sum of the value of the second preset specification and the value of the double preset width; for example, the value of the first preset specification is 32 pixels, and the value of the second preset specification is It is 30 pixels, and the preset width is 1 pixel; or, the value of the first preset specification is 16 pixels, the value of the second preset specification is 14 pixels, and the preset width is 1 pixel.
  • the texture map is divided by the line height of 32 pixels to obtain a plurality of rectangular frames as shown in FIG. 3a, and each of the rectangular frames has a line height of 32 pixels.
  • the position of a fragmented texture of a texture map in the memory is not continuously ordered, it may be scattered, and when multiple pieces of shredded texture are re-spliced into a texture map and rendered, if linear Irregular color seams may occur during sampling; in order to avoid irregular color seams in linear sampling, the shredding process of this embodiment requires special processing, and the special processing may be combined with FIG.
  • 3b-3c specifically: After obtaining a plurality of rectangular frames with a line height of 32 pixels, an edge of 1 pixel is reserved on each of the upper and lower sides of each rectangular frame, and an edge of 1 pixel is added to each of the left and right sides of each rectangular frame to make each rectangle
  • the frame has a central area with a height of 30 pixels and an edge area with a width of 1 pixel surrounding the central area; then the original texture data contained in the texture map is shredded according to a 30 pixel line height to obtain a plurality of fragmented texture data, and Obtaining the edge raw texture data of the surrounding 1 pixel width of each fragmented texture data from the texture map; filling the shredded texture data with the line height of 30 pixels into the central area of the rectangular frame And filling the edges of the original texture data in an edge area pixel width all around, so that a complete filling of the rectangular frame forming a shredding texture.
  • the edge of one pixel is reserved on the upper and lower sides of the rectangular frame, and the edge of one pixel is added to the left and right sides of the rectangular frame to form an edge region.
  • the upper and lower sides of the rectangular frame may also be added with an edge of 1 pixel, or the left and right sides of the rectangular frame may also be reserved with 1 pixel edge.
  • the edge region may be formed by adding pixels or reserved pixels. .
  • the encapsulation process in step S203 may specifically include the following steps s21-s23:
  • S21 Obtain an attribute of each texture map, where the attribute includes an ID, a release type, and offset information, where the release type includes immediate release, automatic release, or resident memory.
  • the ID of a texture map is used to uniquely identify a texture map.
  • the offset information is used to determine where the texture map is stored in the resource file.
  • the release type can be set in the game's rendering engine before the game renders; where:
  • Immediate release means that whether you add or replace a texture map, such access to the texture map does not trigger the loading of the texture map, only when you really need to use the texture map (such as drawing an element in the game scene)
  • the texture map is loaded using the texture map; and, after the texture map is loaded, the memory space occupied by the texture map is released as soon as the texture map is no longer used (such as when the element is destroyed or hidden);
  • the release of the texture map can be delayed, such as delay 2s release or delay 5s release, to prevent the texture texture from being loaded immediately after being released.
  • the texture map used by the game interface is an immediate release type. .
  • Auto-release refers to setting a reference count for a loaded texture map, similar to a smart pointer.
  • the reference count is increased, and the element corresponding to the texture map is destroyed or the texture map is replaced to reduce the reference count. Once the reference count is zeroed, the memory space occupied by the texture map is automatically released.
  • Resident memory means that after the texture map is loaded into the memory, only the internal interface of the game rendering engine can be used to force the memory space occupied by the texture map.
  • the summary information table is stored in a file header of the resource file, and the fragmented texture corresponding to each texture map is stored in the file body of the resource file.
  • the resource file is composed of two parts, the brief information table is stored in the file header, and the file body stores multiple pieces of fragmented texture corresponding to the texture map; the texture map can be realized and broken by the brief information table. On-demand lookup of textures and on-demand loading.
  • the process of the merge rendering of step S104 specifically includes the following steps s31-s34:
  • the preset dynamic loading area in the memory refers to an area pre-allocated in the memory for dynamically loading the fragmented texture.
  • the preset dynamic loading area may be one or several dynamics.
  • the size of the texture map for example: the preset dynamic loading area can be represented as one or several dynamic texture maps with a size of 2048*1024.
  • the preset dynamic loading area in the memory can be cut into several lines according to the first preset specification (16 pixels or 32 pixels), and each line is a dynamic loading line; for each dynamic loading line, a packing algorithm can be used to The free area is allocated, and the free area is allocated to the multiple pieces of shredded texture of the target texture map to be loaded.
  • the merge rendering process here adopts a rendering optimization algorithm, which uses the existing rendering method to calculate the coordinates of the entire texture texture based on the existing rendering method of the entire texture texture and the CPU clipping.
  • the coordinates of each fragmented texture are calculated by the relative position ratio of each fragmented texture in the entire texture map.
  • the rendering optimization algorithm may be represented by the following code segment:
  • the shredded texture in the video memory is arranged in the order of each line.
  • the rendered image effect obtained by combining and rendering multiple shredded textures is exactly the same as the rendered image effect obtained by rendering the entire target texture map, but the memory and memory pressure are significantly reduced, and the rendering performance is obtained. Effective improvement.
  • the game rendering method provided by the embodiment of the present application further includes the following steps:
  • steps S208-S210 after the combined rendering of the multiple pieces of the shredded texture of the target texture map, the memory space occupied by each fragmented texture needs to be released according to the release type of the target texture map; specifically, due to the fragmented texture
  • the dynamic loading line After being loaded into the dynamic loading line in the memory, after releasing the memory space occupied by the fragmented texture, the dynamic loading line reclaims the allocated free area, and the recycled dynamic loading line is merged again. It can be understood that each The dynamic loading line is initially cut by the preset dynamic loading area. After all the dynamic loading lines are recycled, all the dynamic loading lines can be merged to form a preset dynamic loading area.
  • the embodiment of the present application further discloses a game rendering device, which may be a computer program (including program code), and the computer program may run on a terminal (such as a PC, A mobile phone or the like is used to execute the game rendering method described in the above embodiments.
  • a game rendering device which may be a computer program (including program code), and the computer program may run on a terminal (such as a PC, A mobile phone or the like is used to execute the game rendering method described in the above embodiments.
  • a game rendering device may be a computer program (including program code), and the computer program may run on a terminal (such as a PC, A mobile phone or the like is used to execute the game rendering method described in the above embodiments.
  • the game rendering device operates as follows:
  • the file obtaining unit 101 is configured to acquire a resource file of the game, where the resource file includes at least one texture map required for game rendering, and each texture map is separately formed by combining multiple pieces of fragmented texture.
  • the target determining unit 102 is configured to determine a target texture map used by the grid to be rendered in the current running scene of the game.
  • the searching unit 103 is configured to search, from the resource file, a plurality of pieces of fragmented texture corresponding to the target texture map.
  • the merging and rendering unit 104 is configured to perform merging and rendering the multi-block shredded texture of the target texture map.
  • the game rendering device also runs the following unit:
  • the resource packing processing unit 105 is configured to obtain at least one texture map required for game rendering, where the texture map includes original texture data, and respectively reduces each texture map into multiple pieces of fragmented texture, and one piece of fragmented texture includes one Fragmenting the texture data and the edge raw texture data surrounding the preset width of the shredded texture data, and encapsulating the multi-block shredded texture corresponding to each texture map into the resource file.
  • the game rendering device also runs the following unit:
  • Recycling processing unit 106 configured to acquire a release type of the target texture map from a file header of the resource file, and release a dynamic loading line occupied by each fragmented texture of the target texture map according to the acquired release type, and The reclaimed dynamic load rows are merged.
  • the process of the game rendering apparatus running the resource packaging processing unit 105 is specifically: sequentially selecting each texture map, and cutting the selected texture map according to the first preset specification to obtain a plurality of rectangular frames;
  • the original texture data included in the selected texture map is shredded according to the second preset specification to obtain a plurality of fragmented texture data, and the edge original texture data of the preset width is obtained around each of the fragmented texture data;
  • the original texture data of the texture data and the preset width is filled to the corresponding rectangular frame, and a rectangular frame that completes the filling forms a fragmented texture; wherein the value of the first preset specification is greater than or equal to the value of the second preset specification and The sum of the values of twice the preset width;
  • the plurality of shredded texture data and the edge original texture data of the preset width are filled into the corresponding rectangular frame, and the completed rectangular frame forms a shredded texture, including: presetting each of the upper and lower sides of each rectangular frame The edge of the width, and the edge of the preset width is added to the left and right sides of each rectangular frame, so that each rectangular frame has a central area and an edge area surrounding the central area; and the plurality of fragmented texture data are respectively filled to the corresponding rectangular frame a central area, and the edge original texture data surrounding the preset width of each fragmented texture data is respectively filled into the edge area of the corresponding rectangular frame, and a filled rectangular frame forms a fragmented texture;
  • the attributes of each texture map are obtained, where the attributes include an ID, a release type, and offset information, and the release type includes immediate release, automatic release, or resident, generating a brief information table according to attributes of each texture map, and
  • the summary information table is stored in the file header of the resource file, and the multiple pieces of fragmented texture corresponding to each texture map are stored in the file body of the resource file.
  • the process of the game rendering apparatus running the merge rendering unit 104 is specifically: cutting a preset dynamic loading area in a memory according to a first preset specification to form a plurality of dynamic loading lines; using a boxing algorithm Allocating a free area of the dynamically loaded row; sequentially loading the fragmented texture corresponding to the target texture map to a free area of the dynamic loading line; and reading the loaded from the dynamic loading line
  • the shredded texture is submitted to the game's rendering engine for rendering.
  • the steps S101-S104 involved in the game rendering method illustrated in FIG. 1 may be performed by respective units in the game rendering apparatus illustrated in FIG. 5.
  • steps S101-S104 shown in FIG. 1 may be performed by the file acquisition unit 101, the target determination unit 102, the lookup unit 103, and the merge rendering unit 104 shown in FIG. 5, respectively.
  • the steps S201-S203 involved in the method of generating the game resource file shown in FIG. 2 may be performed by the resource packing processing unit 105 shown in FIG. 5.
  • steps S208-S210 may be performed by the recycling processing unit 106 shown in FIG. 5.
  • the embodiment of the present application further discloses a device for generating a game resource file, where the device for generating the game resource file may be a computer program (including program code), and The computer program can be run in a terminal (such as a PC) for performing the method of generating a game resource file as described in the above embodiments.
  • the device for generating the game resource file can run the following units:
  • a texture obtaining unit configured to acquire at least one texture map required for game rendering, the texture map containing original texture data
  • a fragmentation processing unit configured to respectively process each texture map into a plurality of fragmented textures
  • a file encapsulating unit configured to encapsulate the shredded texture corresponding to each texture map into a resource file of the game.
  • the steps S201-S203 involved in the method of generating the game resource file shown in FIG. 2 may be performed by respective units in the above-described game resource file generating apparatus.
  • steps S201-S203 shown in FIG. 2 may be performed by the above-described texture acquisition unit, fragmentation processing unit, and file packaging unit, respectively.
  • each unit in the game rendering device or the game resource file generating device introduced above may be separately or entirely combined into one or several additional units, or some of them (some The unit can also be split into a plurality of functionally smaller units, which can achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present application.
  • the above units are divided based on logical functions.
  • the functions of one unit may also be implemented by multiple units, or the functions of multiple units may be implemented by one unit.
  • the game rendering apparatus may also include other units.
  • these functions may also be implemented by other units, and may be implemented by a plurality of units in cooperation.
  • a general-purpose computing device such as a computer that includes processing elements and storage elements such as a central processing unit (CPU), a random access memory device (RAM), a read only memory device (ROM), and the like.
  • the computer program (including the program code) capable of executing the steps involved in the method shown in FIG. 1 or FIG. 2 is implemented to implement the game rendering method of the embodiment of the present application or the method for generating the game resource file of the embodiment of the present application.
  • the computer program can be recorded, for example, on a computer readable recording medium, and loaded in and run in the above-described computing device by a computer readable recording medium.
  • the computer readable recording medium may also be referred to as a computer readable storage medium or a storage device as described above.
  • the computer readable recording medium may be a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, or an optical data storage device or the like.
  • the texture map is shredded into multiple pieces of shredded texture in the resource packaging process, and the shredding texture corresponding to the target texture map used in the game rendering needs to be loaded, which can effectively reduce the memory loading overhead and reduce the memory load.
  • the combined texture rendering of the shredded texture corresponding to the target texture map can ensure the rendering of the screen effect, avoiding the linear increase of the memory load with the game running, thereby ensuring smooth running of the game.
  • the embodiment of the present application further provides a terminal, where the terminal may be used to perform the corresponding steps of the method flow shown in FIG. 1 or used to execute the method flow shown in FIG. 2 above.
  • the terminal described in the embodiments of the present application includes, but is not limited to, other portable devices such as a mobile phone, a laptop computer or a tablet computer with a touch sensitive surface (for example, a touch screen display and/or a touch pad).
  • the device is not a portable communication device, but a desktop computer having a touch sensitive surface (eg, a touch screen display and/or a touch pad).
  • the internal structure of the terminal may include a processor, a user interface, a network interface, and a storage device.
  • the processor, the user interface, the network interface, and the storage device in the terminal may be connected by a bus or other means.
  • a bus connection is taken as an example.
  • the user interface is a medium for realizing interaction and information exchange between the user and the terminal, and the specific embodiment thereof may include a display for output and a keyboard for input, etc.
  • the keyboard can be either a physical keyboard or a touch screen virtual keyboard, or a keyboard that combines physical and touch screen virtual.
  • the user interface may also include one or more other physical user interface devices such as a mouse and/or joystick.
  • a processor or a central processing unit (CPU) is a computing core of a terminal and a control core, and is adapted to implement one or more instructions, specifically adapted to load and execute one or more instructions to implement a corresponding method.
  • a memory device is a memory device in a terminal for storing programs and data.
  • the storage device herein may include the built-in storage device of the terminal, and may also include an extended storage device supported by the terminal.
  • the storage device provides a storage space that stores the operating system of the terminal.
  • one or more instructions adapted to be loaded and executed by the processor are stored in the storage space, and the instructions may be one or more computer programs (including program code).
  • the storage device herein may be a high-speed RAM memory, or may be a non-volatile memory, such as at least one disk storage; optionally, at least one remote from the foregoing processor. Storage device.
  • the terminal supports various applications, such as one or more of the following: drawing application, presentation application, word processing application, website creation application, disk burning application, spreadsheet application , game apps, phone apps, video conferencing apps, email apps, instant messaging apps, workout support apps, photo management apps, digital camera apps, digital camera apps, web browsing apps, Digital music player app and/or digital video player app.
  • Various applications that can be executed on the terminal can use at least one common physical user interface device such as a touch sensitive surface.
  • One or more functions of the touch sensitive surface and corresponding information displayed on the terminal can be adjusted and/or changed within the application and/or within the respective application.
  • the common physical architecture of the terminal eg, a touch-sensitive surface
  • the processor loads and executes one or more instructions stored in the storage device to implement the corresponding steps of the method flow shown in FIG. 1 or FIG. 2; in a specific implementation, one or one of the storage devices
  • the above instructions are loaded by the processor and perform the following steps:
  • the resource file includes at least one texture map required for game rendering, wherein one piece of the texture map is formed by combining multiple pieces of broken texture;
  • the processor loads one or more instructions in the storage device to perform the following steps before performing the step of acquiring the resource file of the game:
  • the shredded texture includes a shredded texture data and edge original texture data surrounding a preset width of the shredded texture data;
  • the original texture data included in the selected texture map is shredded according to the second preset specification to obtain a plurality of fragmented texture data, and the edge original texture data of the preset width is obtained around each of the fragmented texture data;
  • the value of the first preset specification is greater than or equal to the sum of the value of the second preset specification and the value of twice the preset width.
  • the processor loads one or more instructions in the storage device to perform filling of the plurality of fragmented texture data and the preset original texture data of the edge to the corresponding rectangular frame, and a rectangular frame that completes the filling forms a block.
  • shredding texture the following steps are performed:
  • each rectangular frame Preserving the edge of the preset width on each of the upper and lower sides of each rectangular frame, and adding the edge of the preset width to each of the left and right sides of each rectangular frame, so that each rectangular frame has a central area and an edge area surrounding the central area;
  • the one or more instructions in the processor loading storage device perform the following steps in the step of performing the step of encapsulating the fragmented texture corresponding to each texture map into a resource file, and performing the following steps:
  • attributes of each texture map where the attributes include an ID, a release type, and offset information, and the release type includes immediate release, automatic release, or resident memory;
  • the summary information table is stored in the file header of the resource file, and the fragmented texture corresponding to each texture map is stored in the file body of the resource file.
  • one or more instructions in the processor loading storage device perform the following steps:
  • the preset dynamic loading area in the memory is cut to form a plurality of dynamic loading lines
  • the loaded shredded texture is read from the dynamically loaded row and submitted to the game's rendering engine for rendering.
  • the reclaimed dynamic load rows are merged.
  • one or more instructions in the storage device are loaded by the processor and perform the following steps:
  • the shredded texture corresponding to each texture map is encapsulated into a resource file of the game.
  • the texture map is shredded into multiple pieces of shredded texture in the resource packaging process, and the shredding texture corresponding to the target texture map used in the game rendering needs to be loaded, which can effectively reduce the memory loading overhead and reduce the memory load.
  • the combined texture rendering of the shredded texture corresponding to the target texture map can ensure the rendering of the screen effect, avoiding the linear increase of the memory load with the game running, thereby ensuring smooth running of the game.
  • first and second are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated.
  • features defining “first” and “second” may include at least one of the features, either explicitly or implicitly.
  • the meaning of "a plurality” is at least two, such as two, three, etc., unless specifically defined otherwise.
  • portions of the application can be implemented in hardware, software, firmware, or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a storage device and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
  • each functional unit in each embodiment of the present application may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • General Engineering & Computer Science (AREA)
  • Geometry (AREA)
  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

一种游戏渲染方法、游戏资源文件的生成方法、装置及设备,在资源打包过程中即将纹理贴图碎化处理为多块碎化纹理,按照游戏渲染需要加载所用的目标纹理贴图对应的碎化纹理,能够有效的降低内存加载开销,减小内存负担;另外,对目标纹理贴图对应的碎化纹理进行合并渲染,能够保证渲染画面效果,避免内存负担随游戏运行线性增加,从而保证游戏运行顺畅。

Description

游戏渲染方法、游戏资源文件的生成方法、装置及设备
本申请要求于2017年07月21日提交中华人民共和国国家知识产权局、申请号为201710600237.7、发明名称为“游戏渲染方法、装置、存储设备及终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及互联网技术领域,具体涉及互联网游戏技术领域,尤其涉及一种游戏渲染方法、一种游戏资源文件的生成方法、一种游戏渲染装置、一种游戏资源文件的生成装置、一种存储设备及一种终端。
背景技术
传统的游戏渲染方法,一般是预先将游戏的当前运行场景中可能需要使用的所有纹理贴图(如景物、角色和UI(User Interface,用户界面)等)全部加载至内存中,当需要对某一纹理贴图进行渲染时,从内存中直接获取该纹理贴图,然而很多纹理贴图其实并不是一直在使用,将其加载至内存中,既增加了加载开销,也增加了内存占用,进而造成游戏卡顿。现有技术中还出现另一种游戏渲染方法,能够一定程度上减小内存负担,该方法在资源打包过程中使用纹理合并工具texture packer把多张小纹理贴图合并到一张大纹理贴图中,在需要对多个游戏元素(如景物、角色等)进行渲染时才将该大纹理贴图加载至内存中,从而节省一定加载开销;在渲染多个游戏元素时只要这些元素使用的是同一张大纹理贴图,并且渲染参数一致便可以合并渲染批次,从而提升渲染性能。这种使用纹理合并工具的方法虽然可以提高渲染性能,但需要整张大纹理贴图同时加载到内存,由于游戏运行时存在着大量的纹理复用,这样的方式同样会造成大量的不必要的内存开销,并且随着游戏版本更新和内容增加而使得内存负担显著上升,进而造成游戏卡顿。
发明内容
本申请实施例提供一种游戏渲染方法、游戏资源文件的生成方法、装置、 存储设备及终端,能够保证渲染画面效果,避免内存负担随游戏运行线性增加,从而保证游戏运行顺畅。
一方面,本申请实施例提供一种游戏渲染方法,可包括:
获取游戏的资源文件,所述资源文件包括游戏渲染所需的至少一张纹理贴图,其中,一张所述纹理贴图由多块碎化纹理合并而成;
确定游戏的当前运行场景中待渲染网格所用的目标纹理贴图;
从所述资源文件中查找所述目标纹理贴图对应的碎化纹理;
对所述目标纹理贴图对应的碎化纹理进行合并渲染。
优选地,所述获取游戏的资源文件之前,还包括:
获取所述游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据;
分别将各纹理贴图碎化处理为多块碎化纹理,一块碎化纹理包括一个碎化纹理数据以及包围所述碎化纹理数据的预设宽度的边缘原始纹理数据;
将各纹理贴图对应的碎化纹理封装至所述资源文件中。
优选地,所述分别将各纹理贴图碎化处理为多块碎化纹理,包括:
依次选取各张纹理贴图,将所选纹理贴图按照第一预设规格进行行切割得到多个矩形框;
对所选纹理贴图所包含的原始纹理数据按照第二预设规格进行碎化处理得到多个碎化纹理数据,并在各个碎化纹理数据的四周获取预设宽度的边缘原始纹理数据;
将多个碎化纹理数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理;
其中,第一预设规格的值大于或等于第二预设规格的值与两倍预设宽度的值的总和。
优选地,所述将多个碎化纹理数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理,包括:
在每个矩形框上下两侧各预留预设宽度的边缘,并在每个矩形框左右两侧各增加预设宽度的边缘,使每个矩形框具备中央区和包围中央区的边缘区;
将多个碎化纹理数据分别填充至对应矩形框的中央区,并将包围各个碎化 纹理数据的预设宽度的边缘原始纹理数据分别填充至对应矩形框的边缘区,一个完成填充的矩形框形成一块碎化纹理。
优选地,所述将各纹理贴图对应的碎化纹理封装至所述资源文件中,包括:
获取各纹理贴图的属性,所述属性包括ID(Identity,身份标识)、释放类型及偏移信息,所述释放类型包括立即释放、自动释放或常驻内存;
根据各纹理贴图的属性生成简要信息表;
将所述简要信息表存放至所述资源文件的文件头,将各纹理贴图对应的碎化纹理存放至所述资源文件的文件主体。
优选地,所述对所述目标纹理贴图对应的碎化纹理进行合并渲染,包括:
按照第一预设规格将内存中的预置动态加载区进行行切割,形成多个动态加载行;
采用装箱算法对所述动态加载行的空闲区域进行分配;
依次将所述目标纹理贴图对应的碎化纹理加载至所述动态加载行的空闲区域;
从所述动态加载行中读取所加载的碎化纹理并提交至游戏的渲染引擎进行渲染。
优选地,所述对所述目标纹理贴图对应的碎化纹理进行合并渲染之后,还包括:
从所述资源文件的文件头中获取所述目标纹理贴图的释放类型;
按照所获取的释放类型释放所述目标纹理贴图的各块碎化纹理所占用的动态加载行;
将回收的动态加载行进行合并。
另一方面,本申请实施例提供一种游戏资源文件的生成方法,可包括:
获取游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据;
分别将各纹理贴图碎化处理为多块碎化纹理;
将各纹理贴图对应的碎化纹理封装至所述游戏的资源文件中。
另一方面,本申请实施例提供一种游戏渲染装置,可包括:
文件获取单元,用于获取游戏的资源文件,所述资源文件包括游戏渲染所 需的至少一张纹理贴图,其中,一张所述纹理贴图由多块碎化纹理合并而成;
目标确定单元,用于确定游戏的当前运行场景中待渲染网格所用的目标纹理贴图;
查找单元,用于从所述资源文件中查找所述目标纹理贴图对应的碎化纹理;
合并渲染单元,用于对所述目标纹理贴图对应的碎化纹理进行合并渲染。
优选地,所述游戏渲染装置还包括:
资源打包处理单元,用于获取所述游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据,分别将各纹理贴图碎化处理为多块碎化纹理,一块碎化纹理包括一个碎化纹理数据以及包围所述碎化纹理数据的预设宽度的边缘原始纹理数据,以及将各纹理贴图对应的多块碎化纹理封装至所述资源文件中;以及,
回收处理单元,用于从所述资源文件的文件头中获取所述目标纹理贴图的释放类型,按照所获取的释放类型释放所述目标纹理贴图的各块碎化纹理所占用的动态加载行,以及将回收的动态加载行进行合并。
优选地,所述资源打包处理单元具体用于:依次选取各张纹理贴图,将所选纹理贴图按照第一预设规格进行行切割得到多个矩形框;对所选纹理贴图所包含的原始纹理数据按照第二预设规格进行碎化处理得到多个碎化纹理数据,并在各个碎化纹理数据的四周获取预设宽度的边缘原始纹理数据;将多个碎化纹理数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理;其中,第一预设规格的值大于或等于第二预设规格的值与两倍预设宽度的值的总和;
其中,将多个碎化纹理数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理包括:在每个矩形框上下两侧各预留预设宽度的边缘,并在每个矩形框左右两侧各增加预设宽度的边缘,使每个矩形框具备中央区和包围中央区的边缘区;将多个碎化纹理数据分别填充至对应矩形框的中央区,并将包围各个碎化纹理数据的预设宽度的边缘原始纹理数据分别填充至对应矩形框的边缘区,一个完成填充的矩形框形成一块碎化纹理;以及,
所述资源打包处理单元具体用于:获取各纹理贴图的属性,所述属性包括ID、释放类型及偏移信息,所述释放类型包括立即释放、自动释放或常驻内,根据各纹理贴图的属性生成简要信息表,以及将所述简要信息表存放至所述资源文件的文件头,将各纹理贴图对应的多块碎化纹理存放至所述资源文件的文件主体。
优选地,所述合并渲染单元具体用于:按照第一预设规格将内存中的预置动态加载区进行行切割,形成多个动态加载行;采用装箱算法对所述动态加载行的空闲区域进行分配;依次将所述目标纹理贴图对应的各块碎化纹理加载至所述动态加载行的空闲区域;以及,从所述动态加载行中读取所加载的碎化纹理并提交至游戏的渲染引擎进行渲染。
另一方面,本申请实施例提供一种游戏资源文件的生成装置,可包括:
贴图获取单元,用于获取游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据;
碎化处理单元,用于分别将各纹理贴图碎化处理为多块碎化纹理;
文件封装单元,用于将各纹理贴图对应的碎化纹理封装至所述游戏的资源文件中。
再一方面,本申请实施例还提供一种存储设备,所述存储设备存储有一条或一条以上指令,所述一条或一条以上指令适于由处理器加载并执行本申请实施例所述的游戏渲染方法,或者本申请实施例所述的游戏资源文件的生成方法。
再一方面,本申请实施例还提供一种终端,所述终端包括:
处理器,适于实现一条或一条以上指令;以及,
存储设备,所述存储设备存储有一条或一条以上指令,所述一条或一条以上指令适于由所述处理器加载并执行本申请实施例所述的游戏渲染方法,或者本申请实施例所述的游戏资源文件的生成方法。
本申请实施例在资源打包过程中将纹理贴图碎化处理为多块碎化纹理,按照游戏渲染需要加载所用的目标纹理贴图对应的碎化纹理,能够有效的降低内存加载开销,减小内存负担;另外,对目标纹理贴图对应的碎化纹理进行合并渲染,能够保证渲染画面效果,避免内存负担随游戏运行线性增加,从而保证游戏运行顺畅。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种游戏渲染方法的流程图;
图2为本申请实施例提供的一种游戏资源文件的生成方法的流程图;
图3a-图3c为本申请实施例提供的碎化处理过程的示意图;
图4为本申请实施例提供的合并渲染的画面效果示意图;
图5为本申请实施例提供的一种游戏渲染装置的结构示意图;
图6为本申请实施例提供的一种终端的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
游戏渲染是指计算机绘制游戏的场景画面的一系列处理过程,包括空间光照计算、光栅化和剪裁、纹理采样、深度检测、透明混合等过程。游戏渲染需要使用各类资源,包括动画、纹理贴图等等。其中,纹理贴图是指游戏的运行场景中使用的贴图文件,其能够使得游戏的场景画面更为真实;纹理贴图有各种不同类型的格式,也有各种应用场景,例如:有贴在3D(3 Dimension,三维)模型上或者用于立体空间UI交互上的3D纹理贴图,也有贴在2D平面上或者用于平面UI交互上的2D纹理贴图。纹理采样一般分为最近点采样和线性采样,最近点采样是根据纹理贴图的像素坐标对纹理贴图包含的原始纹理数据进行采样,找到最接近的原始纹理数据,使用最接近的原始纹理数据的像素作为纹理贴图的颜色值;线性采样是在找到最接近的原始纹理数据之后,在这个原始纹理数据附近继续采样多个数据并计算所采样的各个数据的像素平均值,将该像素平均值确定为纹理贴图的颜色值。
一般地,游戏渲染所用到的诸如纹理贴图等资源是在游戏开发过程中由美术制作而成,制作得到的原始资源并不能直接在游戏的应用程序中使用,而是 需要经过一些处理,包括二进制化、加密压缩等,这些处理过程称之为资源打包过程,所获得的文件则是游戏的资源文件,该资源文件中包含游戏渲染所需的动画、纹理贴图等资源,且资源文件中的资源可直接应用至游戏中。
传统的游戏渲染方法,一般是预先将游戏的当前运行场景中可能需要使用的所有纹理贴图(如景物、角色和UI等)全部加载至内存中,当需要对某一纹理贴图进行渲染时,从内存中直接获取该纹理贴图,然而很多纹理贴图其实并不是一直在使用,例如:场景中的某种兵器可能并不是一开始就出现,不需要一开始就渲染,将其加载至内存中,既增加了加载开销,也增加了内存占用,进而造成游戏卡顿。现有技术中还出现另一种游戏渲染方法,能够一定程度上减小内存负担,该方法使用纹理合并工具(如texture packer工具),在资源打包过程中使用texture packer把多张小纹理贴图合并到一张大纹理贴图中,在需要对多个游戏元素(如景物、角色等)进行渲染时才将该大纹理贴图加载至内存中,从而节省一定加载开销;在渲染多个游戏元素时只要这些元素使用的是同一张大纹理贴图,并且渲染参数一致便可以合并渲染批次,从而提升渲染性能。这种使用纹理合并工具的方法虽然可以提高渲染性能,但需要整张大纹理贴图同时加载到内存,由于游戏运行时存在着大量的纹理复用,这样的方式同样会造成大量的不必要的内存开销,并且随着游戏版本更新和内容增加而使得内存负担显著上升,进而造成游戏卡顿。
本申请实施例在资源打包过程中将纹理贴图碎化处理为多块碎化纹理,按照游戏渲染需要加载所用的目标纹理贴图对应的碎化纹理,能够有效的降低内存加载开销,减小内存负担;另外,对目标纹理贴图对应的碎化纹理进行合并渲染,能够保证渲染画面效果,避免内存负担随游戏运行线性增加,从而保证游戏运行顺畅。
基于上述描述,本申请实施例提供了一种游戏渲染方法。该游戏渲染方法可应用于用户侧的终端中,如手机、平板电脑、PC(Personal Computer,个人计算机)等终端。
请参见图1,该游戏渲染方法可包括以下步骤S101-S104。
S101,获取游戏的资源文件,所述资源文件包括游戏渲染所需的至少一张 纹理贴图,其中,一张所述纹理贴图由多块碎化纹理合并而成。
游戏的资源文件是经资源打包过程处理后形成的文件,其包括但不限于游戏渲染所需的一张或多张纹理贴图,还可以包含游戏渲染所需的一些动画资源;此处需要特别说明的是,资源文件中的纹理贴图并非传统的整张纹理贴图,而是由多块碎化纹理拼接合并而成。通常,游戏的资源文件存储在游戏所在的终端的存储空间中,例如:电脑游戏的资源文件存储于电脑为游戏所分配的存储空间中;或者,***的资源文件存储于手机为游戏所分配的存储空间中;那么,可以从游戏所在的终端的存储空间中获取游戏的资源文件。
S102,确定游戏的当前运行场景中待渲染网格所用的目标纹理贴图。
游戏通常会用网格来呈现与区域相关的元素,例如:某游戏场景的某个区域需要呈现地图,那么可基于网格来呈现地图这一元素。常见的网格包括方形网格、六角网格、三角网格等等。一个游戏场景画面通常会包含多个网格,当前需要在某个网格呈现某个元素(如角色、景物等),则需要对该网格进行渲染,此时该网格即为待渲染网格。游戏的场景画面中的网格与所用的纹理贴图在游戏渲染之前已确定,例如:游戏在开发过程中即确定某场景画面中的某个位置应当出现哪个元素,则该场景画面、网格与该元素对应的纹理贴图相关联,具体可以通过场景画面的序号、网格所在像素坐标范围以及纹理贴图ID相关联。因此步骤S102中可以根据游戏的当前运行场景以及待渲染网格来确定所用的目标纹理贴图。
S103,从所述资源文件中查找所述目标纹理贴图对应的碎化纹理。
资源文件中的目标纹理贴图并非一整张纹理贴图,而是由多块碎化纹理拼接合并而成;那么,在确定当前需要渲染目标纹理贴图时,可从资源文件中查找到该目标纹理贴图对应的多块碎化纹理。
S104,对所述目标纹理贴图对应的碎化纹理进行合并渲染。
对目标纹理贴图的多块碎化纹理进行合并渲染,而不对整张目标纹理贴图进行渲染,其目的在于降低显存和提高渲染性能。具体地,合并渲染的过程可包括:首先将目标纹理贴图的多块碎化纹理加载至内存,待加载完成后提交至游戏渲染引擎进行渲染。实际应用中,对多块碎化纹理进行合并渲染所得到的渲染画面效果与对整张目标纹理贴图进行渲染所得到的渲染画面效果保持完 全一致,但内存及显存压力明显减小,渲染性能得到了有效提升。
本申请实施例在资源打包过程中将纹理贴图碎化处理为多块碎化纹理,按照游戏渲染需要加载所用的目标纹理贴图对应的碎化纹理,能够有效的降低内存加载开销,减小内存负担;另外,对目标纹理贴图对应的碎化纹理进行合并渲染,能够保证渲染画面效果,避免内存负担随游戏运行线性增加,从而保证游戏运行顺畅。
本申请实施例还提供了一种游戏资源文件的生成方法。该游戏资源文件的生成方法可应用于游戏开发设计人员所使用的终端中,如PC。
请参见图2,该游戏资源文件的生成方法可包括以下步骤S201-S210。
S201,获取游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据。
S202,分别将各纹理贴图碎化处理为多块碎化纹理。
S203,将各纹理贴图对应的碎化纹理封装至游戏的资源文件中。
步骤S201-S203属于资源打包过程,游戏开发时由美术制作游戏渲染所需的所有纹理贴图,这些纹理贴图以原始纹理数据的形式存在,在资源打包的过程中,对纹理贴图的原理纹理数据进行碎化,一张纹理贴图可以被碎化为多块碎化纹理,这些碎化纹理被封装至资源文件中,供游戏渲染时使用。
可选地,一块碎化纹理包括一个碎化纹理数据以及包围所述碎化纹理数据的预设宽度的边缘原始纹理数据,步骤S202中的碎化处理过程具体可包括以下步骤s11-s13:
s11,依次选取各张纹理贴图,将所选纹理贴图按照第一预设规格进行行切割得到多个矩形框;
s12,对所选纹理贴图所包含的原始纹理数据按照第二预设规格进行碎化处理得到多个碎化纹理数据,并在各个碎化纹理数据的四周获取预设宽度的边缘原始纹理数据;
s13,将多个碎化纹理数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理。
具体实现中,步骤s13可以包括以下过程:首先,在每个矩形框上下两侧 各预留预设宽度的边缘,并在每个矩形框左右两侧各增加预设宽度的边缘,使每个矩形框具备中央区和包围中央区的边缘区;其次,将多个碎化纹理数据分别填充至对应矩形框的中央区,并将包围各个碎化纹理数据的预设宽度的边缘原始纹理数据分别填充至对应矩形框的边缘区,一个完成填充的矩形框形成一块碎化纹理。
每张纹理贴图重复上述步骤s11-s13进行碎化处理,可将所有纹理贴图均碎化为多块碎化纹理。其中,第一预设规格的值大于或等于第二预设规格的值与两倍预设宽度的值的总和;例如:第一预设规格的值为32像素,第二预设规格的值为30像素,预设宽度为1像素;或者,第一预设规格的值为16像素,第二预设规格的值14像素,预设宽度为1像素。
下面结合附图3a-3c对步骤s11-s13的碎化处理过程进行介绍。假设第一预设规格为32像素,将纹理贴图按32像素的行高进行分割可得到图3a所示的多个矩形框,每个矩形框的行高均为32像素。一张纹理贴图的多块碎化纹理在显存中的位置并非连续有序的,其可能是分散的,当多块碎化纹理重新拼接为一张纹理贴图并进行渲染的过程中,如果进行线性采样便会出现不规则的颜色接缝;为了避免线性采样出现不规则的颜色接缝,本实施例碎化处理过程需要进行特殊处理,该特殊处理过程可结合附图3b-3c,具体为:当得到多个行高为32像素的矩形框之后,在每个矩形框上下两侧各预留1像素的边缘,并在每个矩形框左右两侧各增加1像素的边缘,使每个矩形框具备高度为30像素的中央区和包围中央区的宽度为1像素的边缘区;然后对纹理贴图所包含的原始纹理数据按照30像素行高进行碎化处理得到多个碎化纹理数据,并从纹理贴图中获得各个碎化纹理数据的周边1像素宽度的边缘原始纹理数据;将行高为30像素的碎化纹理数据填充至矩形框的中央区,并在四周1像素宽度的边缘区内填充边缘原始纹理数据,这样一个完成填充的矩形框形成一块碎化纹理。
需要说明的是,在上述示例中,仅以在矩形框上下两侧各预留1像素的边缘,并在矩形框左右两侧各增加1像素的边缘,形成边缘区为例。在其它可能的示例中,矩形框上下两侧也可以各增加1像素的边缘,或者矩形框左右两侧也可以各预留1像素的边缘,总之通过增加像素或者预留像素均可形成边缘区。
其中,步骤S203中的封装过程具体可包括以下步骤s21-s23:
s21,获取各纹理贴图的属性,所述属性包括ID、释放类型及偏移信息,所述释放类型包括立即释放、自动释放或常驻内存;
一张纹理贴图的ID用于唯一标识一张纹理贴图。偏移信息用于确定纹理贴图在资源文件中的存储位置。释放类型可以在游戏渲染之前在游戏的渲染引擎中设置;其中:
立即释放是指:无论是增加或者更换纹理贴图,对于纹理贴图的这类访问均不会触发该纹理贴图的加载,只有在真正需要用到该纹理贴图时(比如在游戏场景中绘制某元素需要使用该纹理贴图)才会对该纹理贴图进行加载;并且,该纹理贴图加载完成后,一旦不再使用该纹理贴图时(比如元素销毁或隐藏时)立即释放该纹理贴图所占用的内存空间;并且,对纹理贴图的释放可以采用延时处理,如延时2s释放或延时5s释放,防止该纹理贴图被释放后立即需要加载的情况,通常游戏外界面所使用的纹理贴图为立即释放类型。
自动释放是指:为已加载的纹理贴图设置引用计数,类似于智能指针,该纹理贴图被访问一次则增加引用计数,而该纹理贴图对应的元素销毁或该纹理贴图被更换则减少引用计数,一旦引用计数归零则自动释放该纹理贴图所占用的内存空间。
常驻内存是指:纹理贴图被加载至内存后,只能使用游戏渲染引擎内部接口强制释放该纹理贴图所占用的内存空间。
s22,根据各纹理贴图的属性生成简要信息表;
s23,将所述简要信息表存放至资源文件的文件头,将各纹理贴图对应的碎化纹理存放至资源文件的文件主体。
步骤s21-s23中,资源文件由两部分组成,文件头中存放了简要信息表,而文件主体存放了纹理贴图对应的多块碎化纹理;通过简要信息表能够实现对纹理贴图及其碎化纹理的按需查找及按需加载。
可选地,结合上文介绍的碎化处理过程,在游戏渲染过程中,步骤S104的合并渲染的过程具体包括以下步骤s31-s34:
s31,按照第一预设规格将内存中的预置动态加载区进行行切割,形成多 个动态加载行;
s32,采用装箱算法对所述动态加载行的空闲区域进行分配;
s33,依次将所述目标纹理贴图对应的碎化纹理加载至所述动态加载行的空闲区域;
s34,从所述动态加载行中读取所加载的碎化纹理并提交至游戏的渲染引擎进行渲染。
步骤s31-s34中,内存中的预置动态加载区是指在内存中预分配的、用于动态加载碎化纹理的区域,根据实际情况,预置动态加载区可以为一张或若干张动态纹理贴图的大小,例如:预置动态加载区可以表现为一张或若干张大小为2048*1024的动态纹理贴图。可按照第一预设规格(16像素或32像素)将内存中的预置动态加载区切割成若干行,每一行即为一个动态加载行;针对每一个动态加载行可以采用装箱算法来对其中的空闲区域进行分配,将空闲区域分配给需要加载的目标纹理贴图的多块碎化纹理,待这些碎化纹理被加载完成后,将这些碎化纹理提交至游戏的渲染引擎进行渲染。需要说明的是,此处的合并渲染过程采用渲染优化算法,该渲染优化算法以现有整张纹理贴图的渲染方式和CPU剪裁为基础,利用现有渲染方式计算整张纹理贴图的坐标,然后每块碎化后纹理在整张纹理贴图中的相对位置比例计算每块碎化纹理的坐标。具体实现中,该渲染优化算法可采用以下代码片段表示:
Figure PCTCN2018096002-appb-000001
Figure PCTCN2018096002-appb-000002
Figure PCTCN2018096002-appb-000003
请参见图4所示游戏中的实际渲染效果以及碎化纹理在显存中的存储状态,可以看出显存中的碎化纹理是按每行顺序进行排列的。实际应用中,对多块碎化纹理进行合并渲染所得到的渲染画面效果与对整张目标纹理贴图进行渲染所得到的渲染画面效果保持完全一致,但内存及显存压力明显减小,渲染性能得到了有效提升。
可选地,本申请实施例提供的游戏渲染方法还包括如下几个步骤:
S208,从资源文件的文件头中获取所述目标纹理贴图的释放类型。
S209,按照所获取的释放类型释放所述目标纹理贴图的各块碎化纹理所占用的动态加载行。
S210,将回收的动态加载行进行合并。
步骤S208-S210中,在对目标纹理贴图的多块碎化纹理进行合并渲染之后,需要根据目标纹理贴图的释放类型来释放各块碎化纹理所占用的内存空间;具体地,由于碎化纹理被加载至内存中的动态加载行中,在释放碎化纹理所占用的内存空间后,动态加载行回收其分配出去的空闲区域,回收后的动态加载行再进行合并,可以理解的是,各个动态加载行最初是由预置动态加载区切割得到的,待所有动态加载行被回收后,所有动态加载行又可合并形成预置动态加载区。
基于上述的游戏渲染方法的实施例,本申请实施例还公开了一种游戏渲染装置,该游戏渲染装置可以是一个计算机程序(包括程序代码),且该计算机程序可以运行于终端(如PC、手机等)中以用来执行上文实施例所述的游戏 渲染方法。请参见图5,该游戏渲染装置运行如下单元:
文件获取单元101,用于获取游戏的资源文件,所述资源文件包括游戏渲染所需的至少一张纹理贴图,各纹理贴图分别由多块碎化纹理合并而成。
目标确定单元102,用于确定游戏的当前运行场景中待渲染网格所用的目标纹理贴图。
查找单元103,用于从所述资源文件中查找所述目标纹理贴图对应的多块碎化纹理。
合并渲染单元104,用于对所述目标纹理贴图的多块碎化纹理进行合并渲染。
可选地,所述游戏渲染装置还运行如下单元:
资源打包处理单元105,用于获取游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据,分别将各纹理贴图碎化处理为多块碎化纹理,一块碎化纹理包括一个碎化纹理数据以及包围所述碎化纹理数据的预设宽度的边缘原始纹理数据,以及将各纹理贴图对应的多块碎化纹理封装至资源文件中。
可选地,所述游戏渲染装置还运行如下单元:
回收处理单元106,用于从资源文件的文件头中获取所述目标纹理贴图的释放类型,按照所获取的释放类型释放所述目标纹理贴图的各块碎化纹理所占用的动态加载行,以及将回收的动态加载行进行合并。
具体实现中,该游戏渲染装置运行所述资源打包处理单元105的过程具体为:依次选取各张纹理贴图,将所选纹理贴图按照第一预设规格进行行切割得到多个矩形框;对所选纹理贴图所包含的原始纹理数据按照第二预设规格进行碎化处理得到多个碎化纹理数据,并在各个碎化纹理数据的四周获取预设宽度的边缘原始纹理数据;将多个碎化纹理数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理;其中,第一预设规格的值大于或等于第二预设规格的值与两倍预设宽度的值的总和;
其中,将多个碎化纹理数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理包括:在每个矩形框上下两侧各预留预设宽度的边缘,并在每个矩形框左右两侧各增加预设宽度的边缘,使 每个矩形框具备中央区和包围中央区的边缘区;将多个碎化纹理数据分别填充至对应矩形框的中央区,并将包围各个碎化纹理数据的预设宽度的边缘原始纹理数据分别填充至对应矩形框的边缘区,一个完成填充的矩形框形成一块碎化纹理;以及,
具体为:获取各纹理贴图的属性,所述属性包括ID、释放类型及偏移信息,所述释放类型包括立即释放、自动释放或常驻内,根据各纹理贴图的属性生成简要信息表,以及将所述简要信息表存放至资源文件的文件头,将各纹理贴图对应的多块碎化纹理存放至资源文件的文件主体。
具体实现中,该游戏渲染装置运行所述合并渲染单元104的过程具体为:按照第一预设规格将内存中的预置动态加载区进行行切割,形成多个动态加载行;采用装箱算法对所述动态加载行的空闲区域进行分配;依次将所述目标纹理贴图对应的各块碎化纹理加载至所述动态加载行的空闲区域;以及,从所述动态加载行中读取所加载的碎化纹理并提交至游戏的渲染引擎进行渲染。
根据本申请的一个实施例,图1所示的游戏渲染方法涉及的步骤S101-S104可以是由图5所示的游戏渲染装置中的各个单元来执行的。例如,图1中所示的步骤S101-S104可以分别由图5中所示的文件获取单元101、目标确定单元102、查找单元103和合并渲染单元104来执行。
可选地,图2所示的游戏资源文件的生成方法涉及的步骤S201-S203可以由图5中所示的资源打包处理单元105来执行。
可选地,上述步骤S208-S210可以由图5所示的回收处理单元106来执行。
此外,基于上述的游戏资源文件的生成方法的实施例,本申请实施例还公开了一种游戏资源文件的生成装置,该游戏资源文件的生成装置可以是一个计算机程序(包括程序代码),且该计算机程序可以运行于终端(如PC)中以用来执行上文实施例所述的游戏资源文件的生成方法。示例性地,该游戏资源文件的生成装置可以运行如下单元:
贴图获取单元,用于获取游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据;
碎化处理单元,用于分别将各纹理贴图碎化处理为多块碎化纹理;
文件封装单元,用于将各纹理贴图对应的碎化纹理封装至所述游戏的资源 文件中。
根据本申请的一个实施例,图2所示的游戏资源文件的生成方法涉及的步骤S201-S203可以是由上述游戏资源文件的生成装置中的各个单元来执行的。例如,图2中所示的步骤S201-S203可以分别由上述贴图获取单元、碎化处理单元和文件封装单元来执行。
此外,关于贴图获取单元、碎化处理单元和文件封装单元的具体运行过程,可参见图5实施例中关于资源打包处理单元105的具体运行过程的相关介绍说明,此处不再赘述。
根据本申请的另一个实施例,上文介绍的游戏渲染装置或者游戏资源文件的生成装置中的各个单元可以分别或全部合并为一个或若干个另外的单元来构成,或者其中的某个(些)单元还可以再拆分为功能上更小的多个单元来构成,这可以实现同样的操作,而不影响本申请的实施例的技术效果的实现。上述单元是基于逻辑功能划分的,在实际应用中,一个单元的功能也可以由多个单元来实现,或者多个单元的功能由一个单元实现。在本申请的其它实施例中,游戏渲染装置也可以包括其它单元,在实际应用中,这些功能也可以由其它单元协助实现,并且可以由多个单元协作实现。
根据本申请的另一个实施例,可以通过在包括中央处理单元(CPU)、随机存取存储设备(RAM)、只读存储设备(ROM)等处理元件和存储元件的例如计算机的通用计算设备上运行能够执行如图1或图2中所示的方法涉及的各步骤的计算机程序(包括程序代码),来实现本申请实施例的游戏渲染方法或者实现本申请实施例的游戏资源文件的生成方法。所述计算机程序可以记载于例如计算机可读记录介质上,并通过计算机可读记录介质装载于上述计算设备中,并在其中运行。计算机可读记录介质也可称为计算机可读存储介质或者上文所述的存储设备。例如,计算机可读记录介质可以是ROM、RAM、CD-ROM、磁带、软盘或光数据存储设备等。
本申请实施例在资源打包过程中将纹理贴图碎化处理为多块碎化纹理,按照游戏渲染需要加载所用的目标纹理贴图对应的碎化纹理,能够有效的降低内存加载开销,减小内存负担;另外,对目标纹理贴图对应的碎化纹理进行合并渲染,能够保证渲染画面效果,避免内存负担随游戏运行线性增加,从而保证 游戏运行顺畅。
基于上述实施例所示的方法及装置,本申请实施例还提供了一种终端,该终端可用于执行上述图1所示方法流程的相应步骤,或者用于执行上述图2所示方法流程的相应步骤。具体实现中,本申请实施例中描述的终端包括但不限于诸如具有触摸敏感表面(例如,触摸屏显示器和/或触摸板)的移动电话、膝上型计算机或平板计算机之类的其它便携式设备。还应当理解的是,在某些实施例中,所述设备并非便携式通信设备,而是具有触摸敏感表面(例如,触摸屏显示器和/或触摸板)的台式计算机。请参见图6,该终端的内部结构可包括处理器、用户接口、网络接口及存储设备。其中,终端内的处理器、用户接口、网络接口及存储设备可通过总线或其他方式连接,在本申请实施例所示图6中以通过总线连接为例。
其中,用户接口是实现用户与终端进行交互和信息交换的媒介,其具体体现可以包括用于输出的显示屏(Display)以及用于输入的键盘(Keyboard)等等,需要说明的是,此处的键盘既可以为实体键盘,也可以为触屏虚拟键盘,还可以为实体与触屏虚拟相结合的键盘。然而,应当理解的是,用户接口还可以包括诸如鼠标和/或控制杆的一个或多个其它物理用户接口设备。处理器(或称CPU(Central Processing Unit,中央处理器))是终端的计算核心以及控制核心,其适于实现一条或一条以上指令,具体适于加载并执行一条或一条以上指令从而实现相应方法流程或相应功能;例如:CPU可以用于解析用户向终端所发送的开关机指令,并控制终端进行开关机操作;再如:CPU可以在终端内部结构之间传输各类交互数据,等等。存储设备(Memory)是终端中的记忆设备,用于存放程序和数据。可以理解的是,此处的存储设备既可以包括终端的内置存储设备,当然也可以包括终端所支持的扩展存储设备。存储设备提供存储空间,该存储空间存储了终端的操作***。并且,在该存储空间中还存放了适于被处理器加载并执行的一条或一条以上的指令,这些指令可以是一个或一个以上的计算机程序(包括程序代码)。需要说明的是,此处的存储设备可以是高速RAM存储器,也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器;可选的还可以是至少一个位于远离前述处理器的存储 设备。
还需要特别说明的是,终端支持各种应用程序,例如以下中的一个或多个:绘图应用程序、演示应用程序、文字处理应用程序、网站创建应用程序、盘刻录应用程序、电子表格应用程序、游戏应用程序、电话应用程序、视频会议应用程序、电子邮件应用程序、即时消息收发应用程序、锻炼支持应用程序、照片管理应用程序、数码相机应用程序、数字摄影机应用程序、web浏览应用程序、数字音乐播放器应用程序和/或数字视频播放器应用程序。可以在终端上执行的各种应用程序可以使用诸如触摸敏感表面的至少一个公共物理用户接口设备。可以在应用程序之间和/或相应应用程序内调整和/或改变触摸敏感表面的一个或多个功能以及终端上显示的相应信息。这样,终端的公共物理架构(例如,触摸敏感表面)可以支持具有对用户而言直观且透明的用户界面的各种应用程序。
在本申请实施例中,处理器加载并执行存储设备中存放的一条或一条以上指令,以实现上述图1或图2所示方法流程的相应步骤;具体实现中,存储设备中的一条或一条以上指令由处理器加载并执行如下步骤:
获取游戏的资源文件,所述资源文件包括游戏渲染所需的至少一张纹理贴图,其中,一张所述纹理贴图由多块碎化纹理合并而成;
确定游戏的当前运行场景中待渲染网格所用的目标纹理贴图;
从所述资源文件中查找所述目标纹理贴图对应的碎化纹理;
对所述目标纹理贴图对应的碎化纹理进行合并渲染。
具体实现中,所述处理器加载存储设备中的一条或一条以上指令在执行获取游戏的资源文件这一步骤之前,还执行如下步骤:
获取游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据;
分别将各纹理贴图碎化处理为多块碎化纹理,一块碎化纹理包括一个碎化纹理数据以及包围所述碎化纹理数据的预设宽度的边缘原始纹理数据;
将各纹理贴图对应的碎化纹理封装至资源文件中。
具体实现中,所述处理器加载存储设备中的一条或一条以上指令在执行分别将各纹理贴图碎化处理为多块碎化纹理这一步骤的过程中,具体执行如下步 骤:
依次选取各张纹理贴图,将所选纹理贴图按照第一预设规格进行行切割得到多个矩形框;
对所选纹理贴图所包含的原始纹理数据按照第二预设规格进行碎化处理得到多个碎化纹理数据,并在各个碎化纹理数据的四周获取预设宽度的边缘原始纹理数据;
将多个碎化纹理数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理;
其中,第一预设规格的值大于或等于第二预设规格的值与两倍预设宽度的值的总和。
具体实现中,所述处理器加载存储设备中的一条或一条以上指令在执行将多个碎化纹理数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理这一步骤的过程中,具体执行如下步骤:
在每个矩形框上下两侧各预留预设宽度的边缘,并在每个矩形框左右两侧各增加预设宽度的边缘,使每个矩形框具备中央区和包围中央区的边缘区;
将多个碎化纹理数据分别填充至对应矩形框的中央区,并将包围各个碎化纹理数据的预设宽度的边缘原始纹理数据分别填充至对应矩形框的边缘区,一个完成填充的矩形框形成一块碎化纹理。
具体实现中,所述处理器加载存储设备中的一条或一条以上指令在执行所述将各纹理贴图对应的碎化纹理封装至资源文件中这一步骤的过程中,具体执行如下步骤:
获取各纹理贴图的属性,所述属性包括ID、释放类型及偏移信息,所述释放类型包括立即释放、自动释放或常驻内存;
根据各纹理贴图的属性生成简要信息表;
将所述简要信息表存放至资源文件的文件头,将各纹理贴图对应的碎化纹理存放至资源文件的文件主体。
具体实现中,所述处理器加载存储设备中的一条或一条以上指令在执行所述对所述目标纹理贴图对应的碎化纹理进行合并渲染这一步骤的过程中,具体执行如下步骤:
按照第一预设规格将内存中的预置动态加载区进行行切割,形成多个动态加载行;
采用装箱算法对所述动态加载行的空闲区域进行分配;
依次将所述目标纹理贴图对应的碎化纹理加载至所述动态加载行的空闲区域;
从所述动态加载行中读取所加载的碎化纹理并提交至游戏的渲染引擎进行渲染。
具体实现中,所述处理器加载存储设备中的一条或一条以上指令在执行所述对所述目标纹理贴图的多块碎化纹理进行合并渲染这一步骤之后,还执行如下步骤:
从资源文件的文件头中获取所述目标纹理贴图的释放类型;
按照所获取的释放类型释放所述目标纹理贴图的各块碎化纹理所占用的动态加载行;
将回收的动态加载行进行合并。
在另一个示例中,存储设备中的一条或一条以上指令由处理器加载并执行如下步骤:
获取游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据;
分别将各纹理贴图碎化处理为多块碎化纹理;
将各纹理贴图对应的碎化纹理封装至所述游戏的资源文件中。
本申请实施例在资源打包过程中将纹理贴图碎化处理为多块碎化纹理,按照游戏渲染需要加载所用的目标纹理贴图对应的碎化纹理,能够有效的降低内存加载开销,减小内存负担;另外,对目标纹理贴图对应的碎化纹理进行合并渲染,能够保证渲染画面效果,避免内存负担随游戏运行线性增加,从而保证游戏运行顺畅。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的 具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。
应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储设备中且由合适的指令执行***执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。
以上所揭露的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属本申请所涵盖的范围。

Claims (15)

  1. 一种游戏渲染方法,其特征在于,包括:
    获取游戏的资源文件,所述资源文件包括游戏渲染所需的至少一张纹理贴图,其中,一张所述纹理贴图由多块碎化纹理合并而成;
    确定游戏的当前运行场景中待渲染网格所用的目标纹理贴图;
    从所述资源文件中查找所述目标纹理贴图对应的碎化纹理;
    对所述目标纹理贴图对应的碎化纹理进行合并渲染。
  2. 如权利要求1所述的游戏渲染方法,其特征在于,所述获取游戏的资源文件之前,还包括:
    获取所述游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据;
    分别将各纹理贴图碎化处理为多块碎化纹理,一块碎化纹理包括一个碎化纹理数据以及包围所述碎化纹理数据的预设宽度的边缘原始纹理数据;
    将各纹理贴图对应的碎化纹理封装至所述资源文件中。
  3. 如权利要求2所述的游戏渲染方法,其特征在于,所述分别将各纹理贴图碎化处理为多块碎化纹理,包括:
    依次选取各张纹理贴图,将所选纹理贴图按照第一预设规格进行行切割得到多个矩形框;
    对所选纹理贴图所包含的原始纹理数据按照第二预设规格进行碎化处理得到多个碎化纹理数据,并在各个碎化纹理数据的四周获取预设宽度的边缘原始纹理数据;
    将多个碎化纹理数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理;
    其中,第一预设规格的值大于或等于第二预设规格的值与两倍预设宽度的值的总和。
  4. 如权利要求3所述的游戏渲染方法,其特征在于,所述将多个碎化纹理 数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理,包括:
    在每个矩形框上下两侧各预留预设宽度的边缘,并在每个矩形框左右两侧各增加预设宽度的边缘,使每个矩形框具备中央区和包围中央区的边缘区;
    将多个碎化纹理数据分别填充至对应矩形框的中央区,并将包围各个碎化纹理数据的预设宽度的边缘原始纹理数据分别填充至对应矩形框的边缘区,一个完成填充的矩形框形成一块碎化纹理。
  5. 如权利要求2所述的游戏渲染方法,其特征在于,所述将各纹理贴图对应的碎化纹理封装至所述资源文件中,包括:
    获取各纹理贴图的属性,所述属性包括ID、释放类型及偏移信息,所述释放类型包括立即释放、自动释放或常驻内存;
    根据各纹理贴图的属性生成简要信息表;
    将所述简要信息表存放至所述资源文件的文件头,将各纹理贴图对应的碎化纹理存放至所述资源文件的文件主体。
  6. 如权利要求2-5任一项所述的游戏渲染方法,其特征在于,所述对所述目标纹理贴图对应的碎化纹理进行合并渲染,包括:
    按照第一预设规格将内存中的预置动态加载区进行行切割,形成多个动态加载行;
    采用装箱算法对所述动态加载行的空闲区域进行分配;
    依次将所述目标纹理贴图对应的碎化纹理加载至所述动态加载行的空闲区域;
    从所述动态加载行中读取所加载的碎化纹理并提交至游戏的渲染引擎进行渲染。
  7. 如权利要求5所述的游戏渲染方法,其特征在于,所述对所述目标纹理贴图对应的碎化纹理进行合并渲染之后,还包括:
    从所述资源文件的文件头中获取所述目标纹理贴图的释放类型;
    按照所获取的释放类型释放所述目标纹理贴图的各块碎化纹理所占用的动态加载行;
    将回收的动态加载行进行合并。
  8. 一种游戏资源文件的生成方法,其特征在于,包括:
    获取游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据;
    分别将各纹理贴图碎化处理为多块碎化纹理;
    将各纹理贴图对应的碎化纹理封装至所述游戏的资源文件中。
  9. 一种游戏渲染装置,其特征在于,包括:
    文件获取单元,用于获取游戏的资源文件,所述资源文件包括游戏渲染所需的至少一张纹理贴图,其中,一张所述纹理贴图由多块碎化纹理合并而成;
    目标确定单元,用于确定游戏的当前运行场景中待渲染网格所用的目标纹理贴图;
    查找单元,用于从所述资源文件中查找所述目标纹理贴图对应的碎化纹理;
    合并渲染单元,用于对所述目标纹理贴图对应的碎化纹理进行合并渲染。
  10. 如权利要求9所述的游戏渲染装置,其特征在于,所述游戏渲染装置还包括:
    资源打包处理单元,用于获取所述游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据,分别将各纹理贴图碎化处理为多块碎化纹理,一块碎化纹理包括一个碎化纹理数据以及包围所述碎化纹理数据的预设宽度的边缘原始纹理数据,以及将各纹理贴图对应的多块碎化纹理封装至所述资源文件中;以及,
    回收处理单元,用于从所述资源文件的文件头中获取所述目标纹理贴图的释放类型,按照所获取的释放类型释放所述目标纹理贴图的各块碎化纹理所占用的动态加载行,以及将回收的动态加载行进行合并。
  11. 如权利要求10所述的游戏渲染装置,其特征在于,所述资源打包处理 单元具体用于:依次选取各张纹理贴图,将所选纹理贴图按照第一预设规格进行行切割得到多个矩形框;对所选纹理贴图所包含的原始纹理数据按照第二预设规格进行碎化处理得到多个碎化纹理数据,并在各个碎化纹理数据的四周获取预设宽度的边缘原始纹理数据;将多个碎化纹理数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理;其中,第一预设规格的值大于或等于第二预设规格的值与两倍预设宽度的值的总和;
    其中,将多个碎化纹理数据及预设宽度的边缘原始纹理数据填充至对应矩形框,一个完成填充的矩形框形成一块碎化纹理包括:在每个矩形框上下两侧各预留预设宽度的边缘,并在每个矩形框左右两侧各增加预设宽度的边缘,使每个矩形框具备中央区和包围中央区的边缘区;将多个碎化纹理数据分别填充至对应矩形框的中央区,并将包围各个碎化纹理数据的预设宽度的边缘原始纹理数据分别填充至对应矩形框的边缘区,一个完成填充的矩形框形成一块碎化纹理;以及,
    所述资源打包处理单元具体用于:获取各纹理贴图的属性,所述属性包括ID、释放类型及偏移信息,所述释放类型包括立即释放、自动释放或常驻内,根据各纹理贴图的属性生成简要信息表,以及将所述简要信息表存放至所述资源文件的文件头,将各纹理贴图对应的碎化纹理存放至所述资源文件的文件主体。
  12. 如权利要求10或11所述的游戏渲染装置,其特征在于,所述合并渲染单元具体用于:按照第一预设规格将内存中的预置动态加载区进行行切割,形成多个动态加载行;采用装箱算法对所述动态加载行的空闲区域进行分配;依次将所述目标纹理贴图对应的碎化纹理加载至所述动态加载行的空闲区域;以及,从所述动态加载行中读取所加载的碎化纹理并提交至游戏的渲染引擎进行渲染。
  13. 一种游戏资源文件的生成装置,其特征在于,包括:
    贴图获取单元,用于获取游戏渲染所需的至少一张纹理贴图,所述纹理贴图包含原始纹理数据;
    碎化处理单元,用于分别将各纹理贴图碎化处理为多块碎化纹理;
    文件封装单元,用于将各纹理贴图对应的碎化纹理封装至所述游戏的资源文件中。
  14. 一种存储设备,其特征在于,所述存储设备存储有一条或一条以上指令,所述一条或一条以上指令适于由处理器加载并执行如权利要求1-7任一项所述的游戏渲染方法,或者如权利要求8所述的游戏资源文件的生成方法。
  15. 一种终端,其特征在于,包括:
    处理器,适于实现一条或一条以上指令;以及,
    存储设备,所述存储设备存储有一条或一条以上指令,所述一条或一条以上指令适于由所述处理器加载并执行如权利要求1-7任一项所述的游戏渲染方法,或者如权利要求8所述的游戏资源文件的生成方法。
PCT/CN2018/096002 2017-07-21 2018-07-17 游戏渲染方法、游戏资源文件的生成方法、装置及设备 WO2019015591A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
KR1020207004663A KR102419745B1 (ko) 2017-07-21 2018-07-17 게임 렌더링 방법, 및 게임 자원 파일 생성 방법, 장치, 및 기기
EP18834397.4A EP3657327B1 (en) 2017-07-21 2018-07-17 Method for rendering game, and method, apparatus and device for generating game resource file
JP2020502688A JP6901623B2 (ja) 2017-07-21 2018-07-17 ゲームレンダリング方法、ゲームリソースファイルの生成方法、その方法を実現する装置及びデバイス
US16/745,079 US11344806B2 (en) 2017-07-21 2020-01-16 Method for rendering game, and method, apparatus and device for generating game resource file

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710600237.7A CN107463398B (zh) 2017-07-21 2017-07-21 游戏渲染方法、装置、存储设备及终端
CN201710600237.7 2017-07-21

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/745,079 Continuation US11344806B2 (en) 2017-07-21 2020-01-16 Method for rendering game, and method, apparatus and device for generating game resource file

Publications (1)

Publication Number Publication Date
WO2019015591A1 true WO2019015591A1 (zh) 2019-01-24

Family

ID=60543929

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/096002 WO2019015591A1 (zh) 2017-07-21 2018-07-17 游戏渲染方法、游戏资源文件的生成方法、装置及设备

Country Status (7)

Country Link
US (1) US11344806B2 (zh)
EP (1) EP3657327B1 (zh)
JP (1) JP6901623B2 (zh)
KR (1) KR102419745B1 (zh)
CN (1) CN107463398B (zh)
MA (1) MA49644A (zh)
WO (1) WO2019015591A1 (zh)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110930499A (zh) * 2019-10-12 2020-03-27 深圳国泰安教育技术有限公司 一种3d数据处理方法及装置
CN111127576A (zh) * 2019-12-18 2020-05-08 北京像素软件科技股份有限公司 游戏画面的渲染方法、装置及电子设备
CN111124582A (zh) * 2019-12-26 2020-05-08 珠海金山网络游戏科技有限公司 一种图标调用的方法及装置
CN111127599A (zh) * 2019-12-13 2020-05-08 北京像素软件科技股份有限公司 一种游戏特效的绘制方法和装置
CN111383311A (zh) * 2020-03-06 2020-07-07 网易(杭州)网络有限公司 法线贴图生成方法、装置、设备及存储介质
CN111558224A (zh) * 2020-04-26 2020-08-21 完美世界(北京)软件科技发展有限公司 一种移动端游戏资源打包方法、解包方法、装置及***
CN111773679A (zh) * 2020-08-18 2020-10-16 网易(杭州)网络有限公司 游戏中图标的处理方法及装置
CN111773704A (zh) * 2020-07-31 2020-10-16 网易(杭州)网络有限公司 游戏数据处理方法、装置、存储介质、处理器及电子装置
WO2021091728A1 (en) * 2019-11-04 2021-05-14 Facebook Technologies, Llc Artificial reality system using a multisurface display protocol to communicate surface data
US11145107B2 (en) 2019-11-04 2021-10-12 Facebook Technologies, Llc Artificial reality system using superframes to communicate surface data
CN113709554A (zh) * 2021-08-26 2021-11-26 上海哔哩哔哩科技有限公司 动画视频生成、直播间动画视频播放方法及装置

Families Citing this family (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107463398B (zh) * 2017-07-21 2018-08-17 腾讯科技(深圳)有限公司 游戏渲染方法、装置、存储设备及终端
CN108492342B (zh) * 2018-03-22 2022-05-03 网易(杭州)网络有限公司 合并碎图的方法、装置、处理器、存储介质和终端
CN108537861B (zh) * 2018-04-09 2023-04-18 网易(杭州)网络有限公司 贴图生成方法、装置、设备和存储介质
CN108733441B (zh) * 2018-04-11 2024-06-18 中国电力科学研究院有限公司 一种适用于大规模电网符号设备的渲染可视化方法及***
CN108961382B (zh) * 2018-07-11 2019-11-26 腾讯科技(深圳)有限公司 一种图像渲染方法、装置和存储介质
CN109448094B (zh) * 2018-09-21 2022-07-15 苏州蜗牛数字科技股份有限公司 一种纹理图集调度方法
CN109523588B (zh) * 2018-10-17 2021-07-06 佛山欧神诺云商科技有限公司 一种自定义拼花方法及***
CN109710227B (zh) * 2018-11-07 2022-05-24 苏州蜗牛数字科技股份有限公司 一种纹理图集调度的方法
CN109603155B (zh) 2018-11-29 2019-12-27 网易(杭州)网络有限公司 合并贴图的获取方法、装置、存储介质、处理器及终端
CN110665232A (zh) * 2019-08-30 2020-01-10 网易(杭州)网络有限公司 游戏中地表的渲染方法、装置、设备和存储介质
CN110874856A (zh) * 2019-11-12 2020-03-10 广州银汉科技有限公司 一种基于gpu特性的实时渲染gui的优化方法
CN111028361B (zh) * 2019-11-18 2023-05-02 杭州群核信息技术有限公司 三维模型及材质合并方法、装置、终端、存储介质以及渲染方法
CN111127619A (zh) * 2019-12-20 2020-05-08 珠海金山网络游戏科技有限公司 基于Unity手游场景贴图的优化方法、装置及可读介质
CN111445562B (zh) * 2020-03-12 2023-03-03 稿定(厦门)科技有限公司 文字动画生成方法及装置
CN111581910B (zh) * 2020-03-27 2023-06-13 完美世界(北京)软件科技发展有限公司 一种渲染引擎中的数据缓存方法和装置
CN111476858B (zh) * 2020-04-10 2023-03-14 浙江无端科技股份有限公司 一种基于WebGL的2d引擎渲染方法、装置及设备
KR102173546B1 (ko) 2020-04-28 2020-11-03 주식회사 라이언게임즈 게임 객체 렌더링 방법 및 장치
CN111672109B (zh) * 2020-06-10 2021-12-03 腾讯科技(深圳)有限公司 一种游戏地图生成的方法、游戏测试的方法以及相关装置
CN112419141A (zh) * 2020-07-29 2021-02-26 上海幻电信息科技有限公司 图片处理方法、装置、计算机设备
CN112132936B (zh) * 2020-09-22 2024-03-29 上海米哈游天命科技有限公司 画面渲染方法、装置、计算机设备及存储介质
CN112348934B (zh) * 2020-10-20 2024-07-23 珠海金山数字网络科技有限公司 基于大链表的游戏贴图展示方法、装置及介质
CN113144618B (zh) * 2021-03-29 2022-11-22 腾讯科技(深圳)有限公司 处理图形界面资源的方法、装置、电子设备和存储介质
CN113262480B (zh) * 2021-05-13 2024-06-21 网易(杭州)网络有限公司 三维场景的烘焙方法和装置
CN113384896B (zh) * 2021-06-25 2024-07-12 苏州沁游网络科技有限公司 基于Unity的资源打包方法、装置、设备及介质
CN113487717B (zh) * 2021-07-13 2024-02-23 网易(杭州)网络有限公司 图片处理方法及装置、计算机可读存储介质、电子设备
CN113546411B (zh) * 2021-07-22 2024-06-11 网易(杭州)网络有限公司 游戏模型的渲染方法、装置、终端和存储介质
CN113610907B (zh) * 2021-08-04 2024-04-12 上海仙仙兔网络科技有限公司 一种基于pbr物理渲染的游戏贴图纹理解析***
CN114143603A (zh) * 2021-12-13 2022-03-04 乐府互娱(上海)网络科技有限公司 一种客户端游戏中高兼容性的mp4播放方式

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6587104B1 (en) * 1999-09-30 2003-07-01 Microsoft Corporation Progressive hulls
CN101364310A (zh) * 2007-08-07 2009-02-11 北京灵图软件技术有限公司 一种三维模型图形的生成方法和装置
CN101840566A (zh) * 2010-04-16 2010-09-22 中山大学 一种基于gpu并行计算的实时阴影生成方法及***
CN105931180A (zh) * 2016-04-12 2016-09-07 西安电子科技大学 利用显著信息引导的图像不规则马赛克拼接方法
CN105957133A (zh) * 2016-05-10 2016-09-21 网易(杭州)网络有限公司 一种加载贴图的方法和装置
CN107463398A (zh) * 2017-07-21 2017-12-12 腾讯科技(深圳)有限公司 游戏渲染方法、装置、存储设备及终端

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6771264B1 (en) * 1998-08-20 2004-08-03 Apple Computer, Inc. Method and apparatus for performing tangent space lighting and bump mapping in a deferred shading graphics processor
US7243136B2 (en) * 2000-01-18 2007-07-10 Inktomi Corporation Approach for managing and providing content to users
JP4244572B2 (ja) * 2002-07-04 2009-03-25 ソニー株式会社 キャッシュ装置、およびキャッシュデータ管理方法、並びにコンピュータ・プログラム
CA2489200C (en) * 2002-07-10 2013-06-25 Harman Becker Automotive Systems Gmbh System for texturizing electronic representations of objects
KR20070055420A (ko) * 2004-06-08 2007-05-30 쓰리-비 인터내셔날 리미티드 그래픽 텍스쳐들의 디스플레이
JP2007207328A (ja) * 2006-01-31 2007-08-16 Toshiba Corp 情報記憶媒体、プログラム、情報再生方法、情報再生装置、データ転送方法、及びデータ処理方法
JP4968686B2 (ja) * 2008-01-25 2012-07-04 サミー株式会社 画像圧縮装置、画像再生装置、および画像圧縮プログラム
WO2013111195A1 (ja) * 2012-01-27 2013-08-01 三菱電機株式会社 描画データ生成装置及び画像描画装置
WO2014151796A1 (en) * 2013-03-15 2014-09-25 Robert Bosch Gmbh System and method for display of a repeating texture stored in a texture atlas
US9626789B2 (en) * 2013-05-07 2017-04-18 Advanced Micro Devices, Inc. Implicit texture map parameterization for GPU rendering
WO2015147815A1 (en) * 2014-03-26 2015-10-01 Empire Technology Development Llc Atlas generation based on client video configuration
US9569862B2 (en) * 2014-08-15 2017-02-14 Qualcomm Incorporated Bandwidth reduction using texture lookup by adaptive shading
JP2016058832A (ja) * 2014-09-08 2016-04-21 キヤノン株式会社 画像処理装置、その制御方法、及びプログラム
EP3018630A3 (en) * 2014-09-15 2018-05-16 Samsung Electronics Co., Ltd. Display method and apparatus for rendering repeated geometric shapes
JP6320624B2 (ja) * 2015-03-25 2018-05-09 三菱電機株式会社 テクスチャマッピング装置、テクスチャマッピング方法及びプログラム
KR102292789B1 (ko) * 2015-04-07 2021-08-25 삼성전자 주식회사 디스플레이장치 및 그 제어방법
AU2018203327A1 (en) * 2018-05-11 2019-11-28 Canon Kabushiki Kaisha System and method for processing a graphic object

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6587104B1 (en) * 1999-09-30 2003-07-01 Microsoft Corporation Progressive hulls
CN101364310A (zh) * 2007-08-07 2009-02-11 北京灵图软件技术有限公司 一种三维模型图形的生成方法和装置
CN101840566A (zh) * 2010-04-16 2010-09-22 中山大学 一种基于gpu并行计算的实时阴影生成方法及***
CN105931180A (zh) * 2016-04-12 2016-09-07 西安电子科技大学 利用显著信息引导的图像不规则马赛克拼接方法
CN105957133A (zh) * 2016-05-10 2016-09-21 网易(杭州)网络有限公司 一种加载贴图的方法和装置
CN107463398A (zh) * 2017-07-21 2017-12-12 腾讯科技(深圳)有限公司 游戏渲染方法、装置、存储设备及终端

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LIU, HAO: "Non-official translation: Research on Key Techniques of Multi-scale 3D Disaster Scene Construction and Dynamic Plotting", DOCTORAL DISSERTATION, 15 November 2013 (2013-11-15), pages 1 - 139, XP009518303, ISSN: 1674-022X *
See also references of EP3657327A4

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110930499B (zh) * 2019-10-12 2023-10-13 深圳国匠云职业教育科技有限公司 一种3d数据处理方法及装置
CN110930499A (zh) * 2019-10-12 2020-03-27 深圳国泰安教育技术有限公司 一种3d数据处理方法及装置
WO2021091728A1 (en) * 2019-11-04 2021-05-14 Facebook Technologies, Llc Artificial reality system using a multisurface display protocol to communicate surface data
US11615576B2 (en) 2019-11-04 2023-03-28 Meta Platforms Technologies, Llc Artificial reality system using superframes to communicate surface data
US11430141B2 (en) 2019-11-04 2022-08-30 Facebook Technologies, Llc Artificial reality system using a multisurface display protocol to communicate surface data
US11145107B2 (en) 2019-11-04 2021-10-12 Facebook Technologies, Llc Artificial reality system using superframes to communicate surface data
CN111127599A (zh) * 2019-12-13 2020-05-08 北京像素软件科技股份有限公司 一种游戏特效的绘制方法和装置
CN111127599B (zh) * 2019-12-13 2024-02-23 北京像素软件科技股份有限公司 一种游戏特效的绘制方法和装置
CN111127576B (zh) * 2019-12-18 2023-11-17 北京像素软件科技股份有限公司 游戏画面的渲染方法、装置及电子设备
CN111127576A (zh) * 2019-12-18 2020-05-08 北京像素软件科技股份有限公司 游戏画面的渲染方法、装置及电子设备
CN111124582A (zh) * 2019-12-26 2020-05-08 珠海金山网络游戏科技有限公司 一种图标调用的方法及装置
CN111124582B (zh) * 2019-12-26 2023-04-07 珠海金山数字网络科技有限公司 一种图标调用的方法及装置
CN111383311B (zh) * 2020-03-06 2024-03-01 网易(杭州)网络有限公司 法线贴图生成方法、装置、设备及存储介质
CN111383311A (zh) * 2020-03-06 2020-07-07 网易(杭州)网络有限公司 法线贴图生成方法、装置、设备及存储介质
CN111558224B (zh) * 2020-04-26 2023-10-24 完美世界(北京)软件科技发展有限公司 一种移动端游戏资源打包方法、解包方法、装置及***
CN111558224A (zh) * 2020-04-26 2020-08-21 完美世界(北京)软件科技发展有限公司 一种移动端游戏资源打包方法、解包方法、装置及***
CN111773704A (zh) * 2020-07-31 2020-10-16 网易(杭州)网络有限公司 游戏数据处理方法、装置、存储介质、处理器及电子装置
CN111773704B (zh) * 2020-07-31 2024-02-23 网易(杭州)网络有限公司 游戏数据处理方法、装置、存储介质、处理器及电子装置
CN111773679A (zh) * 2020-08-18 2020-10-16 网易(杭州)网络有限公司 游戏中图标的处理方法及装置
CN111773679B (zh) * 2020-08-18 2024-02-27 网易(杭州)网络有限公司 游戏中图标的处理方法及装置
CN113709554A (zh) * 2021-08-26 2021-11-26 上海哔哩哔哩科技有限公司 动画视频生成、直播间动画视频播放方法及装置

Also Published As

Publication number Publication date
JP2020526851A (ja) 2020-08-31
CN107463398A (zh) 2017-12-12
US20200147491A1 (en) 2020-05-14
EP3657327A1 (en) 2020-05-27
US11344806B2 (en) 2022-05-31
JP6901623B2 (ja) 2021-07-14
KR102419745B1 (ko) 2022-07-11
EP3657327A4 (en) 2021-04-28
CN107463398B (zh) 2018-08-17
KR20200027004A (ko) 2020-03-11
MA49644A (fr) 2020-05-27
EP3657327B1 (en) 2023-01-04

Similar Documents

Publication Publication Date Title
WO2019015591A1 (zh) 游戏渲染方法、游戏资源文件的生成方法、装置及设备
US9715750B2 (en) System and method for layering using tile-based renderers
CN110706341B (zh) 一种城市信息模型的高性能渲染方法、装置及存储介质
TWI686768B (zh) 在移動設備上動畫展現圖像的方法和裝置
US10789770B1 (en) Displaying rich text on 3D models
KR20160120343A (ko) 크로스 플랫폼 렌더링 엔진
US11854143B2 (en) Light probe generation method and apparatus, storage medium, and computer device
KR20140133067A (ko) 그래픽 프로세싱 유닛, 이를 포함하는 그래픽 프로세싱 시스템, 및 이를 이용한 렌더링 방법
US20150310642A1 (en) Atlas generation based on client video configuration
CN111209422A (zh) 图像显示方法、装置、电子设备及存储介质
WO2022242379A1 (zh) 笔画渲染方法、装置、存储介质以及终端
WO2022033162A1 (zh) 一种模型加载方法以及相关装置
WO2019126976A1 (zh) 虚拟现实场景模型建立方法、装置、电子设备和存储介质
US20240189720A1 (en) Performing rendering processing by a graphics processing unit and a central processing unit
CN114564630A (zh) 一种图数据Web3D可视化的方法、***和介质
US20230342018A1 (en) Dynamic element control method, electronic device, and computer readable storage medium
WO2023241210A1 (zh) 虚拟场景的渲染方法、装置、设备及存储介质
CN113934491B (zh) 一种大数据处理方法及装置
WO2023020124A1 (zh) 数据处理方法、装置、计算设备和***
WO2024103756A1 (zh) 一种三维模型的显示方法、装置、电子设备及存储介质
CN106657560B (zh) 图像处理方法及移动终端
AU2021202516A1 (en) Systems and methods for converting composite image data
CN111402375A (zh) 百叶窗效果的形成方法、装置和渲染引擎

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18834397

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020502688

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 20207004663

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2018834397

Country of ref document: EP

Effective date: 20200221