CN111569418B - Rendering method, device and medium for content to be output and electronic equipment - Google Patents

Rendering method, device and medium for content to be output and electronic equipment Download PDF

Info

Publication number
CN111569418B
CN111569418B CN202010524843.7A CN202010524843A CN111569418B CN 111569418 B CN111569418 B CN 111569418B CN 202010524843 A CN202010524843 A CN 202010524843A CN 111569418 B CN111569418 B CN 111569418B
Authority
CN
China
Prior art keywords
image block
map
coordinates
target image
grid
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010524843.7A
Other languages
Chinese (zh)
Other versions
CN111569418A (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 CN202010524843.7A priority Critical patent/CN111569418B/en
Publication of CN111569418A publication Critical patent/CN111569418A/en
Application granted granted Critical
Publication of CN111569418B publication Critical patent/CN111569418B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/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/05Geographic models
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The embodiment of the disclosure provides a rendering method for content to be output, a rendering device for the content to be output, a computer readable medium and an electronic device, and relates to the technical field of computers; the method comprises the following steps: selecting a target image block from a plurality of image blocks according to the current position of the virtual object in the image resource, wherein the plurality of image blocks are obtained by dividing the image resource according to a preset size; loading the target image block into a map for containing the target image block, wherein the map comprises a plurality of grid objects; determining the coordinates of the target image block in the map according to the coordinates of the grid object; and rendering the content to be output according to the coordinates of the target image block in the map, wherein the content to be output comprises the image block to be displayed in the target image block. The technical scheme of the embodiment of the disclosure overcomes the problem of low rendering efficiency at least to a certain extent, reduces the frequency of requesting rendering operation by applying the image blocks to the same map, and improves the rendering efficiency of the content to be output.

Description

Rendering method, device and medium for content to be output and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method for rendering content to be output, an apparatus for rendering content to be output, a computer-readable medium, and an electronic device.
Background
When a user runs a terminal game, the server generally needs to render a game picture according to the current position of the user, so that the game picture is more vivid, and the impression of the user is improved. Generally, a game scene map is included in a game picture, when a user moves a current position, the scene map within a visual field of the user needs to be rendered, and the use experience of the user is directly affected by the speed of the rendering. In general, a scene map is obtained by splicing map blocks, and maps corresponding to different map blocks are different, a user may include a plurality of map blocks in a visual field, and if the map blocks need to be rendered, multiple rendering requests need to be performed to achieve rendering of each different map block in the visual field. However, this causes a problem of low rendering efficiency.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
An object of the embodiments of the present disclosure is to provide a rendering method for content to be output, a rendering apparatus for content to be output, a computer-readable medium, and an electronic device, which overcome the problem of low rendering efficiency at least to some extent, reduce the frequency of requesting rendering operations by applying image blocks to the same map, and improve the rendering efficiency for content to be output.
A first aspect of an embodiment of the present disclosure provides a rendering method for content to be output, including:
selecting a target image block from a plurality of image blocks according to the current position of the virtual object in the image resource, wherein the plurality of image blocks are obtained by dividing the image resource according to a preset size;
loading the target image block into a map for containing the target image block, wherein the map comprises a plurality of grid objects, and the grid objects are obtained by dividing the map according to a preset size;
determining the coordinates of the target image block in the map according to the coordinates of the grid object;
and rendering the content to be output according to the coordinates of the target image block in the map, wherein the content to be output comprises the image block to be displayed in the target image block.
In an exemplary embodiment of the present disclosure, before selecting a target image block from a plurality of image blocks according to a current position of a virtual object in an image resource, the method may further include:
and partitioning the picture resources according to the preset size, outputting image blocks meeting the preset size, and outputting the image blocks not meeting the preset size in the partitioning result according to the preset size to obtain a plurality of image blocks.
In an exemplary embodiment of the present disclosure, the map includes a first display area and a second display area, where the number of the grid objects in the first display area is smaller than the number of the grid objects in the second display area, the second display area is the same as the size of the map, and the first display area is used for storing the image block to be displayed.
In an exemplary embodiment of the present disclosure, determining coordinates of a target image block in a map from coordinates of a mesh object includes:
numbering the grid objects, and calculating initial vertex coordinates of the grid objects according to the numbering result, the number of the rows where the grid objects are located and the number of the columns where the grid objects are located;
determining the initial vertex coordinates of the grid object as the initial vertex coordinates of a target image block corresponding to the grid object in the map;
and determining all coordinates of the target image block in the map according to the coordinates of the starting vertex of the target image block in the map.
In an exemplary embodiment of the present disclosure, after rendering the content to be output according to the coordinates of the target image block in the map, the method may further include the following steps:
when the current position is detected to be changed, determining an image block to be loaded from a plurality of image blocks, and determining an image block to be discarded from a target image block;
discarding the image blocks to be discarded, and loading the image blocks to be loaded into the map;
determining the coordinates of the image blocks to be loaded in the map according to the coordinates of the grid object;
and rendering the content to be output according to the coordinates of the image blocks to be loaded in the map.
In an exemplary embodiment of the present disclosure, loading an image block to be loaded into a map includes:
changing the storage state of the grid object corresponding to the image block to be discarded into the state of the image block which is not stored;
and loading the image blocks to be loaded to the grid object in the state of not storing the image blocks in the map.
In an exemplary embodiment of the present disclosure, after loading an image block to be loaded into a grid object in a state of an image block not stored in a map, the method may further include the following steps:
updating a preset data structure; the preset data structure is used for recording the storage state, the numbering result and the corresponding relation between the grid object and the target image block.
According to a second aspect of the embodiments of the present disclosure, there is provided a rendering apparatus for content to be output, including a target image block selecting unit, a target image block loading unit, a coordinate determining unit, and a content to be output rendering unit, wherein:
the target image block selecting unit is used for selecting a target image block from a plurality of image blocks according to the current position of the virtual object in the image resource, wherein the plurality of image blocks are obtained by dividing the image resource according to the preset size;
the target image block loading unit is used for loading the target image block into a map for containing the target image block, the map comprises a plurality of grid objects, and the grid objects are obtained by dividing the map according to a preset size;
the coordinate determination unit is used for determining the coordinates of the target image block in the map according to the coordinates of the grid object;
and the content to be output rendering unit is used for rendering the content to be output according to the coordinates of the target image block in the map, wherein the content to be output comprises the image block to be displayed in the target image block.
In an exemplary embodiment of the present disclosure, the apparatus further includes an image resource segmentation unit, wherein:
and the image resource dividing unit is used for dividing the image resource according to the preset size before the target image block selecting unit selects the target image block from the plurality of image blocks according to the current position of the virtual object in the image resource, outputting the image block meeting the preset size, and outputting the image block not meeting the preset size in the dividing result according to the preset size to obtain the plurality of image blocks.
In an exemplary embodiment of the present disclosure, a map includes a first display area and a second display area, where the number of grid objects in the first display area is smaller than the number of grid objects in the second display area, the second display area has the same size as the map, and the first display area is used for storing an image block to be displayed.
In an exemplary embodiment of the present disclosure, the coordinate determination unit determines coordinates of the target image block in the map according to coordinates of the mesh object, including:
the coordinate determination unit numbers the grid objects and calculates the initial vertex coordinates of the grid objects according to the numbering result and the number of the lines and the number of the columns of the grid objects;
the coordinate determination unit determines the initial vertex coordinate of the grid object as the initial vertex coordinate of a target image block corresponding to the grid object in the map;
the coordinate determination unit determines all coordinates of the target image block in the map according to the starting vertex coordinates of the target image block in the map.
In an exemplary embodiment of the present disclosure, the apparatus may further include a to-be-loaded image block determining unit and a to-be-loaded image block loading unit, where:
the to-be-loaded image block determining unit is used for determining an image block to be loaded from the plurality of image blocks and determining an image block to be discarded from the target image block when the current position is detected to be changed after the to-be-output content rendering unit renders the to-be-output content according to the coordinates of the target image block in the map;
the to-be-loaded image block loading unit is used for discarding the to-be-discarded image block and loading the to-be-loaded image block into the map;
the coordinate determination unit is also used for determining the coordinates of the image blocks to be loaded in the map according to the coordinates of the grid objects;
and the content to be output rendering unit is also used for rendering the content to be output according to the coordinates of the image blocks to be loaded in the map.
In an exemplary embodiment of the present disclosure, the loading unit of the image block to be loaded loads the image block to be loaded into the map, including:
the to-be-loaded image block loading unit changes the storage state of the grid object corresponding to the to-be-discarded image block into the state of the image block which is not stored;
and the image block to be loaded is loaded to the grid object in the state of not storing the image block in the map by the image block to be loaded loading unit.
In an exemplary embodiment of the present disclosure, the apparatus may further include a data structure updating unit, wherein:
the data structure updating unit is used for updating the preset data structure after the image block to be loaded is loaded to the grid object in the state of not storing the image block in the map by the image block to be loaded loading unit; the preset data structure is used for recording the storage state, the numbering result and the corresponding relation between the grid object and the target image block.
According to a third aspect of embodiments of the present disclosure, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements a rendering method for content to be output as described in the first aspect of the embodiments above.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: one or more processors; a storage device for storing one or more programs which, when executed by one or more processors, cause the one or more processors to implement a rendering method for content to be output as described in the first aspect of the embodiments above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in some embodiments of the present disclosure, a target image block (i.e., a map block where a virtual object is located) may be selected from a plurality of image blocks (e.g., map blocks) according to a current position of the virtual object in an image resource (e.g., a map resource in a game), where the plurality of image blocks are obtained by dividing the image resource according to a preset size (e.g., 256 × 256). Furthermore, the target image block may be loaded into a map for accommodating the target image block, the map including a plurality of mesh objects, the plurality of mesh objects being obtained by dividing the map according to a preset size. Furthermore, the content to be output can be rendered according to the coordinates of the target image block in the map, wherein the content to be output comprises the image block to be displayed in the target image block. According to the method and the device, the target image blocks are applied to the same map, so that the problem that the rendering efficiency is low due to the fact that the number of rendering requests is large and the rendering request is low due to the fact that different map blocks correspond to different maps is solved, and the rendering efficiency is improved; on the other hand, since the target image block includes the image block to be displayed, it can be deduced that the target image block includes other image blocks besides the image block to be displayed, and the other image blocks are not in a state to be displayed, but when the virtual object moves the current position, the update efficiency of the image block in the view field can be improved according to the other image blocks.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
Fig. 1 schematically shows a schematic diagram of an exemplary system architecture of a rendering method for content to be output and a rendering apparatus for content to be output to which an embodiment of the present disclosure may be applied;
FIG. 2 schematically illustrates a structural schematic diagram of a computer system suitable for use with an electronic device that implements an embodiment of the disclosure;
fig. 3 schematically shows a flow chart of a rendering method for content to be output according to one embodiment of the present disclosure;
FIG. 4 schematically illustrates a diagram of a plurality of image blocks obtained by segmenting an image resource according to a preset size according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates a diagram of output results for a plurality of image blocks, according to an embodiment of the present disclosure;
fig. 6 schematically shows a flow chart of a rendering method for content to be output according to another embodiment of the present disclosure;
fig. 7 schematically shows a block schematic diagram of a rendering method for content to be output according to one embodiment of the present disclosure;
fig. 8 schematically shows a block diagram of a rendering apparatus for content to be output in an embodiment according to the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and a repetitive description thereof will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
Fig. 1 is a schematic diagram illustrating a system architecture of an exemplary application environment to which a rendering method for content to be output and a rendering apparatus for content to be output according to an embodiment of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to desktop computers, portable computers, smart phones, tablet computers, and the like. It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, and the like.
FIG. 2 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present disclosure.
It should be noted that the computer system 200 of the electronic device shown in fig. 2 is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiments of the present disclosure.
As shown in fig. 2, the computer system 200 includes a Central Processing Unit (CPU) 201 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 202 or a program loaded from a storage section 208 into a Random Access Memory (RAM) 203. In the (RAM) 203, various programs and data necessary for system operation are also stored. The (CPU) 201, (ROM) 202, and (RAM) 203 are connected to each other by a bus 204. An input/output (I/O) interface 205 is also connected to bus 204.
The following components are connected to the (I/O) interface 205: an input portion 206 including a keyboard, a mouse, and the like; an output section 207 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 208 including a hard disk and the like; and a communication section 209 including a network interface card such as a LAN card, a modem, or the like. The communication section 209 performs communication processing via a network such as the internet. The driver 210 is also connected to the (I/O) interface 205 as necessary. A removable medium 211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 210 as necessary, so that a computer program read out therefrom is mounted into the storage section 208 as necessary.
In particular, the processes described below with reference to the flowcharts may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 209 and/or installed from the removable medium 211. The computer program, when executed by a Central Processing Unit (CPU) 201, performs various functions defined in the methods and apparatus of the present application.
It should be noted that the computer readable media shown in the present disclosure may be computer readable signal media or computer readable storage media or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method as described in the embodiments below. For example, the electronic device may implement the various steps shown in fig. 3, and so on.
Generally, the scene map content in the game is more, a larger storage space is needed, and if the scene map content is not split, the problem of unsmooth loading of a scene is caused, and a certain waste of computing resources is caused. In addition, if the scene map file is not split, the modification efficiency of the scene map is low, because if part of the content in the scene map file needs to be modified, the whole scene map file needs to be modified. For the above reasons, the scene map resource needs to be split into multiple map tile resources. When the scene map is rendered, all map tile resources in a visual field range taking a player as a center are dynamically loaded according to the visual field of the player and are rendered, the visual field of the player can move, and map tiles in the visual field range can be dynamically updated.
Generally, a scene map is obtained by splicing map segments, and maps corresponding to different map segments are different, a user may include multiple map segments within a visual field range, and if the map segments need to be rendered, multiple rendering requests need to be performed, so as to implement rendering of each different map segment within the visual field range. However, this causes a problem of low rendering efficiency.
Based on one or more of the problems described above, the present example embodiment provides a rendering method for content to be output. Referring to fig. 3, the rendering method for content to be output may include the following steps S310 to S340, specifically:
step S310: and selecting a target image block from the plurality of image blocks according to the current position of the virtual object in the image resource, wherein the plurality of image blocks are obtained by dividing the image resource according to a preset size.
Step S320: and loading the target image block into a map for containing the target image block, wherein the map comprises a plurality of grid objects, and the grid objects are obtained by dividing the map according to a preset size.
Step S330: and determining the coordinates of the target image block in the map according to the coordinates of the grid object.
Step S340: and rendering the content to be output according to the coordinates of the target image block in the map, wherein the content to be output comprises the image block to be displayed in the target image block.
By implementing the rendering method for the content to be output shown in fig. 3, the problem of more rendering requests and lower rendering efficiency caused by different image blocks corresponding to different maps can be reduced by applying the target image blocks to the same map, so that the rendering efficiency is improved. In addition, since the target image block includes the image block to be displayed, it can be deduced that the target image block includes other image blocks besides the image block to be displayed, and the other image blocks are not in a state to be displayed, but when the virtual object moves to the current position, the update efficiency of the image block in the visual field range can be improved according to the other image blocks.
The above steps of the present exemplary embodiment will be described in more detail below.
In step S310, a target image block is selected from a plurality of image blocks according to a current position of the virtual object in the image resource, and the image blocks are obtained by dividing the image resource according to a preset size.
The image resource may be a map resource in a game scene, and the map resource may be a 2D (two-dimensional) resource or a 3D (three-dimensional) resource, which is not limited in the embodiment of the present application. The size of the image resource (e.g., 6000 × 6000) may be larger than the predetermined size (e.g., 256 × 256). In addition, the image resources can be obtained by splicing a plurality of image blocks. Further, the virtual object may be a virtual character in the game scene, and the current position may be represented by coordinates (u, v), where u represents a coordinate of the virtual object in the horizontal direction of the image resource and v represents a coordinate of the virtual object in the vertical direction of the image resource. In addition, the number of the target image blocks is smaller than the number of the plurality of image blocks, the target image blocks include image blocks to be displayed and image blocks not to be displayed, and the image blocks of the plurality of image blocks except the target image block may be temporary unloaded image blocks.
In addition, optionally, the manner of selecting the target image block from the plurality of image blocks according to the current position of the virtual object in the image resource may specifically be: determining the current position of the virtual object in the image resource, matching an image block to be displayed and an image block not to be displayed corresponding to the current position according to the resolution, and determining the image block to be displayed and the image block not to be displayed as target image blocks. The image block to be displayed can be an image block which needs to be displayed, namely, an image block in the visual field range of a user; the undisplayed image block may be an image block adjacent to or separated from the image block to be displayed by a predetermined distance, i.e., an image block that may become an image block to be displayed.
In addition, the method for selecting the target image block from the plurality of image blocks according to the current position of the virtual object in the image resource may specifically be: determining the resolution of an operation terminal corresponding to the virtual object, and determining the visual field range of the virtual object according to the resolution; determining a current position of the virtual object in the image resource; and selecting a target image block from the plurality of image blocks according to the visual field range and the current position.
In this embodiment of the application, optionally, before selecting a target image block from a plurality of image blocks according to the current position of the virtual object in the image resource, the method may further include the following steps:
and partitioning the picture resources according to the preset size, outputting image blocks meeting the preset size, and outputting the image blocks not meeting the preset size in the partitioning result according to the preset size to obtain a plurality of image blocks.
The segmentation result comprises image blocks meeting the preset size and image blocks not meeting the preset size.
In addition, the method for segmenting the picture resource according to the preset size may specifically be: and carrying out grid division on the image resources according to a preset size from the upper left corner of the image resources.
In addition, the manner of outputting the image blocks which do not satisfy the preset size in the segmentation result according to the preset size may specifically be: and determining an area to be supplemented according to the position of the image block which does not meet the preset size in the segmentation result in the segmentation grid, supplementing the area to be supplemented through black pixels, obtaining the image block which meets the preset size, and outputting the image block.
Referring to fig. 4, fig. 4 schematically illustrates a plurality of image blocks obtained by dividing an image resource according to a preset size according to an embodiment of the present disclosure. Fig. 4 shows image blocks 401 to 420, where the image blocks 401 to 420 are obtained by dividing an image resource, and the original image resource can be obtained by stitching the image blocks 401 and 420. The image block 405, the image block 410, the image block 415, the image block 416, the image block 417, the image block 418, the image block 419, and the image block 420 in the image resource are divided, and then the divided results do not satisfy the preset size, that is, the image block 405, the image block 410, the image block 415, the image block 416, the image block 417, the image block 418, the image block 419, and the image block 420 in the divided results are different from other image block sizes. Furthermore, the image block 405, the image block 410, the image block 415, the image block 416, the image block 417, the image block 418, the image block 419, and the image block 420 may satisfy the predetermined size by complementing the pixels of the image block 405, the image block 410, the image block 415, the image block 416, the image block 417, the image block 418, the image block 419, and the image block 420.
Further, the image blocks 401 to 420 may be sequentially numbered. Specifically, the number corresponding to the image block 401 is 1, the number corresponding to the image block 402 is 2, the number corresponding to the image block 403 is 3, the number corresponding to the image block 404 is 4, the number corresponding to the image block 405 is 5, the number corresponding to the image block 406 is 6, the number corresponding to the image block 407 is 7, the number corresponding to the image block 408 is 8, the number corresponding to the image block 409 is 9, the number corresponding to the image block 410 is 10, the number corresponding to the image block 411 is 11, the number corresponding to the image block 412 is 12, the number corresponding to the image block is 13, the number corresponding to the image block 414 is 14, the number corresponding to the image block 415 is 15, the number corresponding to the image block 416 is 16, the number corresponding to the image block 417 is 17, the number corresponding to the image block 418 is 18, the number corresponding to the image block 419 is 19, and the number corresponding to the image block 420 is 20. The image blocks 401 to 420 are stored and output according to the numbers, the storage format may be png, or bmp, jpg, tif, gif, pcx, tga, exif, fpx, svg, psd, cdr, pcd, dxf, ufo, eps, ai, raw, WMF, webp, or the like, and the embodiment of the present application is not limited.
Further, referring to fig. 5, fig. 5 schematically illustrates a schematic diagram of output results for a plurality of image blocks according to an embodiment of the present disclosure. Fig. 5 includes output results after the image blocks 401 to 420 in fig. 4 are stored and output by number. The storage result corresponding to image block 401 is 1.png, the storage result corresponding to image block 402 is 2.png, the storage result corresponding to image block 403 is 3.png, the storage result corresponding to image block 404 is 4.png, the storage result corresponding to image block 405 is 5.png, the storage result corresponding to image block 406 is 6.png, the storage result corresponding to image block 407 is 7.png, the storage result corresponding to image block 408 is 8.png, the storage result corresponding to image block 409 is 9.png, the storage result corresponding to image block 410 is 10.png, the storage result corresponding to image block 411 is 11.png, the storage result corresponding to image block 412 is 12.png, the storage result corresponding to image block 413 is 13.png, the storage result corresponding to image block 414 is 14.png, the storage result corresponding to image block 415 is 15.png, the storage result corresponding to image block 416 is 16.png, the storage result corresponding to image block 417 is 17.png, the storage result corresponding to image block 418.png is 18.png, and the storage result corresponding to image block 418.png.
Therefore, by implementing the optional embodiment, the image resources can be segmented, the problem that partial resources can be obtained only by loading the whole image resources when partial resources in the image resources are loaded is avoided, the calculation amount of resource loading can be reduced, the resource loading efficiency is improved, and the problem of loading jamming is avoided to a certain extent. In addition, because the image resources are divided, when part of the content in the image resources is modified, only the corresponding image blocks need to be modified, and the whole image resources do not need to be modified, so that the patch content can be reduced, and the modification efficiency of the image resources is improved.
In step S320, the target image block is loaded into a map for accommodating the target image block, where the map includes a plurality of mesh objects, and the mesh objects are obtained by dividing the map according to a preset size.
The map comprises a first display area and a second display area, wherein the number of grid objects in the first display area is smaller than that of grid objects in the second display area, the size of the second display area is the same as that of the map, and the first display area is used for storing image blocks to be displayed. The second display region includes the first display region. A mesh object may store a target image block.
Further, before step S320, the method may further include the steps of: a map is created for accommodating the target image block. The map can accommodate all tiles within the field of view (i.e., the tiles to be displayed) and a certain number of temporarily invisible cached tiles (i.e., the tiles not to be displayed); the image blocks to be displayed can be loaded into the first display area, and the image blocks not to be displayed can be loaded into other areas except the first display area in the second display area. This may speed up the display of tiles, which may be map tiles, such as game map assets, as the player moves the field of view.
For example, the map for accommodating the image block is divided according to the preset size 256 × 256, so as to obtain M × N mesh objects; wherein M and N are positive integers, and M and N can be the same or different. When M = N =4, the divided maps are as follows:
12 13 14 15
8 9 10 11
4 5 6 7
0 1 2 3
after the map is divided to obtain a plurality of grid objects, the grid objects can be numbered, and as described above, the grid objects with the numbers of 0 to 15 can be obtained by numbering from the lower left corner in a row-first traversal increasing manner from 0. If the first display area may include m × n target image blocks, the second display area may include (m + 1) × (n + 1) target image blocks; where m and n are positive integers, m +1= M, n +1= N.
Further, assume that the first display area is as follows:
9 10
5 6
as can be seen, the first display area may include 2*2 target image blocks, where the mesh object numbers in the first display area may be continuous or discontinuous, which is not limited in this embodiment of the application.
In step S330, the coordinates of the target image block in the map are determined according to the coordinates of the mesh object.
In this embodiment of the present application, optionally, determining coordinates of the target image block in the map according to the coordinates of the mesh object includes:
numbering the grid objects, and calculating initial vertex coordinates of the grid objects according to the numbering result, the number of the rows where the grid objects are located and the number of the columns where the grid objects are located;
determining the initial vertex coordinates of the grid object as the initial vertex coordinates of a target image block corresponding to the grid object in the map;
and determining all coordinates of the target image block in the map according to the coordinates of the starting vertex of the target image block in the map.
The number of the rows where the grid object is located is the number of the rows where the grid object is located in the divided map, and the number of the columns where the grid object is located is the number of the columns where the grid object is located in the divided map. In addition, the start vertex coordinates of the mesh object may be coordinates corresponding to a vertex at the lower left corner of the mesh object, and the start vertex coordinates may be (u, v), where u represents coordinates of the vertex at the lower left corner of the mesh object in the horizontal direction of the map, and v represents coordinates of the vertex at the lower left corner of the mesh object in the vertical direction of the map.
In addition, the mesh objects may be numbered in a specific manner: and sequentially numbering the grid objects from bottom to top and from right to left.
In addition, the manner of calculating the initial vertex coordinates of the mesh object according to the numbering result and the number of rows and columns of the mesh object may specifically be: determining a numbering result grid _ index corresponding to the grid object, a number M of rows where the grid object is located and a number N of columns where the grid object is located, and determining a U coordinate and a V coordinate corresponding to the grid object, wherein the U coordinate = (grid _ index% N)/N, and the V coordinate = (grid _ index% M)/M; determining (u, v) as the initial vertex coordinates corresponding to the mesh object; and determining the initial vertex coordinates corresponding to each mesh object according to the process. For example, if M = N =4 and grid_index is 0, then the starting vertex coordinate (u, v) corresponding to the grid coordinate is (0,0); if M = N =4 and grid_index is 5, then the starting vertex coordinate (u, v) corresponding to the grid coordinate is (0.25).
In addition, the way of determining all coordinates of the target image block in the map according to the coordinates of the starting vertex of the target image block in the map may specifically be: and determining the other three vertex coordinates of the target image block in the map according to the starting vertex coordinates of the target image block in the map. For example, if the target image block is loaded into the mesh object with number 0, the starting vertex coordinate of the target image block in the map may be (0,0), and the other three vertex coordinates include: the vertex coordinates of the upper left corner (0,1/4), the vertex coordinates of the lower right corner (1/4,0) and the vertex coordinates of the upper right corner (1/4), and the set of the starting vertex coordinate and the other three vertex coordinates are all the coordinates of the target image block in the map.
Therefore, by implementing the optional embodiment, the position and the range of the grid object in the map can be timely located by numbering the grid object and the initial vertex coordinate of the grid object, so that the efficiency of determining the coordinate of the target image block is improved, and the subsequent rendering efficiency of the content to be output is improved.
In step S340, the content to be output is rendered according to the coordinates of the target image block in the map, where the content to be output includes the image block to be displayed in the target image block.
The content to be output may include an image block within a visual field range, and the area corresponding to the visual field range may be the first display area in the map.
In this embodiment of the application, optionally, after rendering the content to be output according to the coordinates of the target image block in the map, the method may further include the following steps:
when the current position is detected to be changed, determining an image block to be loaded from a plurality of image blocks, and determining an image block to be discarded from a target image block;
discarding the image blocks to be discarded, and loading the image blocks to be loaded into the mapping;
determining the coordinates of the image blocks to be loaded in the map according to the coordinates of the grid object;
and rendering the content to be output according to the coordinates of the image blocks to be loaded in the map.
The method for determining the image block to be loaded from the plurality of image blocks and determining the image block to be discarded from the target image block may specifically be: determining the coordinate of the current position in the image resource, determining the visual field range according to the coordinate, and determining the image block to be loaded according to the visual field range; and determining to-be-discarded image blocks which do not belong to the visual field range in the target image block and discarding the image blocks.
In addition, the method for determining the coordinates of the image block to be loaded in the map according to the coordinates of the grid object may specifically be: and determining the coordinates of the grid object for storing the image block to be loaded, and determining the coordinates of the grid object as the coordinates of the image block to be loaded in the map.
In addition, the method for rendering the content to be output according to the coordinates of the image block to be loaded in the map specifically may be: and generating a rendering operation instruction according to the coordinates of the image block to be loaded in the map, and executing the rendering operation instruction to realize the rendering of the content to be output, wherein the content to be output can be the content in the visual field range.
Therefore, by implementing the optional embodiment, the image blocks to be displayed can be updated when the current position of the virtual object changes, position updating of the image blocks in all the first display areas is not needed, and only new image blocks to be displayed need to be added, so that the subsequent rendering efficiency of the content to be output can be improved, the user experience is improved, and the use viscosity of the user is improved.
Further optionally, loading the image block to be loaded into the map includes:
changing the storage state of the grid object corresponding to the image block to be discarded into the state of the image block not stored;
and loading the image blocks to be loaded to the grid objects in the state of not storing the image blocks in the map.
And discarding the image blocks in the non-visual field range of the image blocks. Optionally, the manner of changing the storage state of the grid object corresponding to the to-be-discarded image block to the state of the image block that is not stored may be: and discarding the image blocks to be discarded, and changing the storage state of the grid object corresponding to the image blocks to be discarded from the state of storing the visible image blocks to the state of not storing the image blocks.
In addition, the manner of loading the image block to be loaded to the grid object in the state of not storing the image block in the map may specifically be: determining a first grid object set in a state of not storing image blocks and a second grid object set in a state of storing invisible image blocks in a preset data structure; determining a first image block in a first display area and a second image block in a second display area in the image blocks to be loaded; selecting a first target grid object from the first grid object set, and loading a first image block into the first target grid object; and selecting a second target grid object from the second grid object set, and loading the second image block into the second target grid object. The target grid object may be selected randomly or according to the storage state change time, which is not limited in the embodiments of the present application.
Therefore, by implementing the optional embodiment, the loading efficiency of the image blocks to be loaded can be improved by changing the storage state, and the mesh objects in the map are partially modified according to the partial change of the image blocks in the visual field range, so that the rendering efficiency of the content to be output can be improved.
Further optionally, after the image block to be loaded is loaded to the grid object in the state of the image block not stored in the map, the method may further include the following steps:
updating a preset data structure; the preset data structure is used for recording the storage state, the numbering result and the corresponding relation between the grid object and the target image block.
Wherein, predetermine data structure and be used for carrying out data storage, predetermine data structure and include: the number result corresponding to each mesh object, the storage status corresponding to each mesh object, and the target image block resource corresponding to each mesh object (which may also be understood as the correspondence between the mesh object and the target image block described above). Wherein, the storage state may include: an undeployed image tile state, a deposited visible image tile state, and a deposited invisible image tile state. In addition, the preset data structure may also be used to record a set of grid objects corresponding to each storage state, that is, a set of grid objects in the same storage state.
Therefore, by implementing the optional embodiment, the rendering efficiency of the content to be output when the image block in the visual field is changed can be improved by updating the preset data structure.
Referring to fig. 6, fig. 6 schematically illustrates a flowchart of a rendering method for content to be output according to another embodiment of the present disclosure. As shown in fig. 6, a rendering method for content to be output of another embodiment includes: step S600 to step S690, wherein:
step S600: the method comprises the steps of dividing a picture resource according to a preset size, outputting image blocks meeting the preset size, outputting the image blocks not meeting the preset size in a division result according to the preset size to obtain a plurality of image blocks, and selecting a target image block from the plurality of image blocks according to the current position of a virtual object in the picture resource.
Step S610: and dividing the mapping for accommodating the target image block according to the preset size to obtain a plurality of grid objects, and loading the target image block into the mapping.
Step S620: and numbering the grid objects, and calculating the initial vertex coordinates of the grid objects according to the numbering result, the number of the rows where the grid objects are located and the number of the columns where the grid objects are located.
Step S630: and determining the initial vertex coordinates of the grid object as the initial vertex coordinates of the target image block corresponding to the grid object in the map.
Step S640: and determining all coordinates of the target image block in the map according to the coordinates of the starting vertex of the target image block in the map.
Step S650: and rendering the content to be output according to the coordinates of the target image block in the map, wherein the content to be output comprises the image block to be displayed in the target image block.
Step S660: when the current position is detected to be changed, determining an image to be loaded from the plurality of image blocks, and determining an image block to be discarded from the target image block.
Step S670: and discarding the image blocks to be discarded, changing the storage state of the grid object corresponding to the image blocks to be discarded into the state of the image blocks not stored, and loading the image blocks to be loaded to the grid object in the state of the image blocks not stored in the map.
Step S680: updating a preset data structure; the preset data structure is used for recording the storage state, the numbering result and the corresponding relation between the grid object and the target image block.
Step S690: and determining the coordinates of the image blocks to be loaded in the map according to the coordinates of the grid object, and rendering the content to be output according to the coordinates of the image blocks to be loaded in the map.
It should be noted that steps S600 to S690 correspond to the steps in fig. 3 and the embodiment thereof, and for the specific implementation of steps S600 to S690, please refer to the embodiment in fig. 3, which is not described herein again.
It can be seen that, by implementing the rendering method for the content to be output shown in fig. 6, the problem of more rendering requests and lower rendering efficiency caused by different image blocks corresponding to different maps can be reduced by applying the target image blocks to the same map, and the rendering efficiency is further improved. In addition, since the target image block includes the image block to be displayed, it can be deduced that the target image block includes other image blocks besides the image block to be displayed, and the other image blocks are in a state of not being displayed, but when the virtual object moves the current position, the update efficiency of the image block in the visual field range can be improved according to the other image blocks.
The embodiment of the application can be applied to rendering of a scene map in a game, please refer to fig. 7, and fig. 7 schematically illustrates a module diagram of a rendering method for content to be output according to an embodiment of the disclosure. As shown in FIG. 7, the module schematic includes a scene map resource splitting module 710, a merged map management module 720, a map tile loading and updating module 730, and a coordinates updating module 740.
The scene map resource splitting module 710 is configured to split the image resource according to a preset size to obtain a plurality of image blocks. When the image resource is a scene map in the game, the scene resource may be divided according to a preset size of 256 × 256, and a plurality of blocks may be obtained and output.
The merge map management module 720 includes a create merge map unit 721, a trellis dividing unit 722, a trellis state management unit 723, and a merge map update unit 724. The create merge map unit 721 is configured to create a map for accommodating a target image block, where the target image block is selected from a plurality of image blocks according to a current position of a virtual object in an image resource; the grid dividing unit 722 is configured to divide the map for accommodating the target image block according to a preset size to obtain a plurality of grid objects, and is configured to record a corresponding relationship between the grid objects and the target image block; the grid state management unit 723 is configured to store a preset data structure, where the preset data structure is configured to record storage states of the grid objects, numbering results of the grid objects, and grid object sets corresponding to the storage states, and when a change in the current position is detected, the grid state management unit may update the preset data structure; the merged map updating unit 724 is configured to determine, when it is detected that the current position changes, a target grid object in which an image block to be loaded may be stored, load the image block to be loaded into the target grid object, and then implement local updating of the first display area in the map.
A map tile loading and updating module 730, configured to load and update map tile resources (i.e., target image tiles) in the field of view (i.e., in the first display region), and update the storage status of the grid object.
A coordinate updating module 740, configured to obtain the number of the grid object corresponding to the map block (i.e., the target image block) in the map within the field of view, so as to determine (u, v) of the sprite object corresponding to the map block resource; the sprite object can be a model corresponding to the map block resource.
It can be seen that, by implementing the module schematic diagram shown in fig. 7, the problem of high rendering request times and low rendering efficiency caused by different image blocks corresponding to different maps can be reduced by applying the target image blocks to the same map, and the rendering efficiency is further improved. In addition, since the target image block includes the image block to be displayed, it can be deduced that the target image block includes other image blocks besides the image block to be displayed, and the other image blocks are not in a state to be displayed, but when the virtual object moves to the current position, the update efficiency of the image block in the visual field range can be improved according to the other image blocks.
Further, in the present exemplary embodiment, there is also provided a rendering apparatus for content to be output. Referring to fig. 8, the rendering apparatus for content to be output may include a target image block selection unit 801, a target image block loading unit 802, a coordinate determination unit 803, and a content to be output rendering unit 804, where:
a target image block selecting unit 801, configured to select a target image block from multiple image blocks according to a current position of a virtual object in an image resource, where the multiple image blocks are obtained by dividing the image resource according to a preset size;
a target image block loading unit 802, configured to load a target image block into a map for accommodating the target image block, where the map includes a plurality of mesh objects, and the mesh objects are obtained by dividing the map according to a preset size;
a coordinate determination unit 803, configured to determine coordinates of the target image block in the map according to the coordinates of the grid object;
and the content to be output rendering unit 804 is configured to render the content to be output according to the coordinates of the target image block in the map, where the content to be output includes an image block to be displayed in the target image block.
The map comprises a first display area and a second display area, wherein the number of grid objects in the first display area is smaller than that of grid objects in the second display area, the size of the second display area is the same as that of the map, and the first display area is used for storing image blocks to be displayed.
It can be seen that, by applying the target image blocks to the same map, the rendering apparatus for content to be output shown in fig. 8 can reduce the problem of high rendering request times and low rendering efficiency caused by different map blocks corresponding to different maps, thereby improving the rendering efficiency. In addition, since the target image block includes the image block to be displayed, it can be deduced that the target image block includes other image blocks besides the image block to be displayed, and the other image blocks are not in a state to be displayed, but when the virtual object moves to the current position, the update efficiency of the image block in the visual field range can be improved according to the other image blocks.
In an exemplary embodiment of the present disclosure, the apparatus further includes an image resource segmentation unit (not shown), wherein:
and the image resource dividing unit is configured to divide the image resource according to a preset size before the target image block selecting unit 801 selects the target image block from the plurality of image blocks according to the current position of the virtual object in the image resource, output the image block meeting the preset size, and output the image block not meeting the preset size in the division result according to the preset size, so as to obtain the plurality of image blocks.
Therefore, by implementing the optional embodiment, the image resources can be segmented, the problem that partial resources can be obtained only by loading the whole image resources when partial resources in the image resources are loaded is avoided, the calculation amount of resource loading can be reduced, the resource loading efficiency is improved, and the problem of loading jamming is avoided to a certain extent. In addition, because the image resources are divided, when part of the content in the image resources is modified, only the corresponding image blocks need to be modified, and the whole image resources do not need to be modified, so that the patch content can be reduced, and the modification efficiency of the image resources is improved.
In an exemplary embodiment of the present disclosure, the coordinate determination unit 803 determines the coordinates of the target image block in the map according to the coordinates of the mesh object, including:
the coordinate determination unit 803 numbers the grid objects, and calculates the initial vertex coordinates of the grid objects according to the numbering result and the number of rows and columns of the grid objects;
the coordinate determination unit 803 determines the start vertex coordinates of the mesh object as the start vertex coordinates of the target image block corresponding to the mesh object in the map;
the coordinate determination unit 803 determines all coordinates of the target image block in the map from the starting vertex coordinates of the target image block in the map.
Therefore, by implementing the optional embodiment, the position and the range of the grid object in the map can be timely located by numbering the grid object and the initial vertex coordinate of the grid object, so that the efficiency of determining the coordinate of the target image block is improved, and the subsequent rendering efficiency of the content to be output is improved.
In an exemplary embodiment of the present disclosure, the apparatus may further include a to-be-loaded image block determining unit (not shown) and a to-be-loaded image block loading unit (not shown), wherein:
a to-be-loaded image block determining unit, configured to determine, when a change in a current position is detected after the to-be-output content rendering unit 804 renders the to-be-output content according to the coordinates of the target image block in the map, an image block to be loaded from the plurality of image blocks, and determine an image block to be discarded from the target image block;
the to-be-loaded image block loading unit is used for discarding the to-be-discarded image block and loading the to-be-loaded image block into the map;
the coordinate determination unit 803 is further configured to determine, according to the coordinates of the grid object, the coordinates of the image block to be loaded in the map;
and the content to be output rendering unit 804 is further configured to render the content to be output according to the coordinates of the image block to be loaded in the map.
Therefore, by implementing the optional embodiment, the image blocks to be displayed can be updated when the current position of the virtual object changes, position updating of the image blocks in all the first display areas is not needed, and only new image blocks to be displayed need to be added, so that the subsequent rendering efficiency of the content to be output can be improved, the user experience is improved, and the use viscosity of the user is improved.
In an exemplary embodiment of the present disclosure, the loading unit of the image block to be loaded loads the image block to be loaded into the map, including:
the to-be-loaded image block loading unit changes the storage state of the grid object corresponding to the to-be-discarded image block into the state of the image block which is not stored;
and the image block to be loaded is loaded to the grid object in the state of not storing the image block in the map by the image block to be loaded loading unit.
Therefore, by implementing the optional embodiment, the loading efficiency of the image blocks to be loaded can be improved by changing the storage state, and the mesh objects in the map are partially modified according to the partial change of the image blocks in the visual field range, so that the rendering efficiency of the content to be output can be improved.
In an exemplary embodiment of the present disclosure, the apparatus may further include a data structure updating unit (not shown), wherein:
the data structure updating unit is used for updating the preset data structure after the image block to be loaded is loaded to the grid object in the state of not storing the image block in the map by the image block to be loaded loading unit; the preset data structure is used for recording the storage state, the numbering result and the corresponding relation between the grid object and the target image block.
Therefore, by implementing the optional embodiment, the rendering efficiency of the content to be output when the image block in the visual field is changed can be improved by updating the preset data structure.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Since each functional module of the rendering apparatus for content to be output of the exemplary embodiment of the present disclosure corresponds to the steps of the exemplary embodiment of the rendering method for content to be output described above, please refer to the above-described embodiment of the rendering method for content to be output of the present disclosure for details that are not disclosed in the embodiment of the apparatus of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A rendering method for content to be output, comprising:
selecting a target image block from a plurality of image blocks according to the current position of the virtual object in the image resource, wherein the plurality of image blocks are obtained by dividing the image resource according to a preset size;
loading the target image block into a map for containing the target image block, wherein the map comprises a plurality of grid objects, and the grid objects are obtained by dividing the map according to the preset size;
determining the coordinates of the target image block in the map according to the coordinates of the grid object;
and rendering contents to be output according to the coordinates of the target image blocks in the map, wherein the contents to be output comprise image blocks to be displayed in the target image blocks.
2. The method of claim 1, wherein prior to selecting the target tile from the plurality of tiles based on the current position of the virtual object in the image resource, the method further comprises:
and partitioning the image resources according to the preset size, outputting image blocks meeting the preset size, and outputting the image blocks not meeting the preset size in partitioning results according to the preset size to obtain a plurality of image blocks.
3. The method according to claim 1, wherein the map comprises a first display area and a second display area, wherein the number of grid objects in the first display area is smaller than the number of grid objects in the second display area, the second display area has the same size as the map, and the first display area is used for storing the image block to be displayed.
4. The method of claim 1, wherein determining coordinates of the target image block in the map from coordinates of the mesh object comprises:
numbering the grid objects, and calculating initial vertex coordinates of the grid objects according to numbering results and the number of the rows and the number of the columns of the grid objects;
determining the initial vertex coordinates of the grid object as the initial vertex coordinates of the target image block corresponding to the grid object in the map;
and determining all coordinates of the target image block in the map according to the initial vertex coordinates of the target image block in the map.
5. The method of claim 4, wherein after rendering the content to be output according to the coordinates of the target tile in the map, the method further comprises:
when the current position is detected to be changed, determining image blocks to be loaded from the plurality of image blocks, and determining image blocks to be discarded from the target image blocks;
discarding the image blocks to be discarded, and loading the image blocks to be loaded into the map;
determining the coordinates of the image blocks to be loaded in the map according to the coordinates of the grid object;
and rendering the content to be output according to the coordinates of the image blocks to be loaded in the map.
6. The method according to claim 5, wherein loading the image block to be loaded into the map comprises:
changing the storage state of the grid object corresponding to the image block to be discarded into the state of the image block not stored;
and loading the image blocks to be loaded to the grid object in the state of the image blocks which are not stored in the map.
7. The method of claim 6, wherein after loading the tile to be loaded onto the grid object in the tile not in the tile deposited state, the method further comprises:
updating a preset data structure; the preset data structure is used for recording the storage state, the numbering result and the corresponding relation between the grid object and the target image block.
8. A rendering apparatus for content to be output, comprising:
the target image block selecting unit is used for selecting a target image block from a plurality of image blocks according to the current position of the virtual object in the image resource, wherein the plurality of image blocks are obtained by dividing the image resource according to the preset size;
the target image block loading unit is used for loading the target image block into a map for containing the target image block, the map comprises a plurality of grid objects, and the grid objects are obtained by dividing the map according to the preset size;
a coordinate determination unit, configured to determine, according to the coordinates of the mesh object, coordinates of the target image block in the map;
and the content to be output rendering unit is used for rendering the content to be output according to the coordinates of the target image block in the map, wherein the content to be output comprises the image block to be displayed in the target image block.
9. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, implements a rendering method for content to be output according to any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a rendering method for content to be output as claimed in any one of claims 1 to 7.
CN202010524843.7A 2020-06-10 2020-06-10 Rendering method, device and medium for content to be output and electronic equipment Active CN111569418B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010524843.7A CN111569418B (en) 2020-06-10 2020-06-10 Rendering method, device and medium for content to be output and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010524843.7A CN111569418B (en) 2020-06-10 2020-06-10 Rendering method, device and medium for content to be output and electronic equipment

Publications (2)

Publication Number Publication Date
CN111569418A CN111569418A (en) 2020-08-25
CN111569418B true CN111569418B (en) 2023-04-07

Family

ID=72124131

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010524843.7A Active CN111569418B (en) 2020-06-10 2020-06-10 Rendering method, device and medium for content to be output and electronic equipment

Country Status (1)

Country Link
CN (1) CN111569418B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112614221A (en) * 2020-12-29 2021-04-06 北京百度网讯科技有限公司 High-precision map rendering method and device, electronic equipment and automatic driving vehicle
CN117392348B (en) * 2023-10-25 2024-06-18 上海久尺网络科技有限公司 Multi-object jitter elimination method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108154548A (en) * 2017-12-06 2018-06-12 北京像素软件科技股份有限公司 Image rendering method and device
CN109584366A (en) * 2018-12-10 2019-04-05 浙江科澜信息技术有限公司 A kind of terrain rendering method, apparatus, equipment and readable storage medium storing program for executing
CN110163943A (en) * 2018-11-21 2019-08-23 深圳市腾讯信息技术有限公司 The rendering method and device of image, storage medium, electronic device
CN111091610A (en) * 2019-11-22 2020-05-01 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108154548A (en) * 2017-12-06 2018-06-12 北京像素软件科技股份有限公司 Image rendering method and device
CN110163943A (en) * 2018-11-21 2019-08-23 深圳市腾讯信息技术有限公司 The rendering method and device of image, storage medium, electronic device
CN109584366A (en) * 2018-12-10 2019-04-05 浙江科澜信息技术有限公司 A kind of terrain rendering method, apparatus, equipment and readable storage medium storing program for executing
CN111091610A (en) * 2019-11-22 2020-05-01 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111569418A (en) 2020-08-25

Similar Documents

Publication Publication Date Title
CN111260766B (en) Virtual light source processing method, device, medium and electronic equipment
US20140152664A1 (en) Method of rendering a terrain stored in a massive database
CN109671147B (en) Texture map generation method and device based on three-dimensional model
CN111569418B (en) Rendering method, device and medium for content to be output and electronic equipment
KR102050169B1 (en) Spatial indexing method of three dimensional model for 3d map service based on octree structure and method and apparatus for providing 3d map service using the same
CN106548500A (en) A kind of two-dimension situation image processing method and device based on GPU
CN110930492B (en) Model rendering method, device, computer readable medium and electronic equipment
CN113495933A (en) Vector tile display method and system
CN111870953A (en) Height map generation method, device, equipment and storage medium
CN109960887B (en) LOD-based model making method and device, storage medium and electronic equipment
US6219058B1 (en) Bin-per-span based representation and communication of graphical data
US11348287B2 (en) Rendering of graphic objects with pattern paint using a graphics processing unit
US20220189027A1 (en) Panorama Rendering Method, Electronic Device and Storage Medium
CN110555916A (en) Terrain editing method and device for virtual scene, storage medium and electronic equipment
JP7352032B2 (en) Video generation method, apparatus, electronic device and computer readable storage medium
WO2018175299A1 (en) System and method for rendering shadows for a virtual environment
JPH10198823A (en) Video generating device
CN110662099B (en) Method and device for displaying bullet screen
CN113592990A (en) Three-dimensional effect generation method, device, equipment and medium for two-dimensional image
CN112580213B (en) Method and device for generating display image of electric field lines and storage medium
CN111506680B (en) Terrain data generation and rendering method and device, medium, server and terminal
CN117899474B (en) Picture rendering method and device, electronic equipment and readable medium
CN117112950B (en) Rendering method, device, terminal and storage medium for objects in electronic map
CN116416378A (en) Method and device for generating three-dimensional building table
CN115797287A (en) Image processing method and device

Legal Events

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