A method and system for displaying brief information of 3D game objects

By concentrating the vertex data of the game object's brief information into a large buffer and updating it once per frame, the performance degradation caused by excessive rendering state switching is solved, and efficient rendering performance and stable game frame rate are achieved.

CN115040869BActive Publication Date: 2025-07-25GUIZHOU BOYI MUTUAL ENTERTAINMENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210679982.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-15
Publication Date
2025-07-25
Estimated Expiration
2042-06-15

AI Technical Summary

Technical Problem

When a large number of game objects are displayed on the same screen, there are too many rendering state switching and buffer update operations in the prior art, resulting in a degradation of game engine rendering performance and reducing game frame rate.

Method used

Generate the vertex data of all game objects' brief information into a large enough vertex buffer, cache the text and icon information on the corresponding texture, and update the vertex buffer only once per frame and set the hardware rendering state once, reducing the update operation of buffer and rendering state.

Benefits of technology

It effectively reduces the use of rendering hardware resources, ensures the stability of game frame rate, and maintains efficient rendering performance even when a large number of characters are displayed on the same screen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115040869B_ABST
    Figure CN115040869B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for displaying brief information of 3D game objects. By generating vertex data of all object brief information into a vertex buffer large enough to accommodate all the vertex numbers required for this frame; dynamically caching the text to be displayed in the brief information onto a texture; and making all the icons to be used in the brief information onto a large texture; these three main operations are used to achieve that the rendering of brief information of all characters is completed with only one vertex buffer, and only one vertex buffer needs to be updated, the required hardware rendering state needs to be set once, and a rendering request needs to be submitted once per frame, avoiding a large number of time-consuming buffer updates, rendering state setting operations and rendering requests. In this way, when the number of characters displayed on the same screen is very large, displaying the brief information of characters only occupies very little rendering hardware resources, and the impact on the entire rendering system can be basically ignored.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of game rendering, and particularly relates to a method and system for displaying brief information of 3D game objects. Background Art

[0002] Currently, the main way to display brief information of game objects in the game field is to set a virtual point on the game model. When displaying brief information such as the name, health bar, and status icon of the game object, the following steps are carried out: 1. Calculate the window coordinate value of the point in the game window based on the three-dimensional world coordinates of the virtual point of the character and the current camera settings. This coordinate value serves as the coordinate origin of the brief information display system of the object; 2. Construct grid vertex data in combination with the display design of the object brief information system and write it into the vertex buffer, and at the same time generate corresponding material data; 3. Update the vertex buffer and material attributes to the corresponding rendering state of the rendering hardware and then submit a rendering instruction. Usually, when the rendering hardware executes a rendering instruction, it outputs pixels to the display buffer for the mesh data in the specified vertex buffer and some other rendering states and parameters (such as primitive type, vertex format, shading mode, texture sampling mode, vertex shader program, and pixel shader program). Finally, rendering an object by the rendering engine is such a loop of updating the rendering state of the rendering hardware and then submitting a rendering operation instruction. Relatively speaking, the switching of rendering states and the update of buffers are very time-consuming operation instructions, and in the design of the game engine, the switching of rendering states and the update of buffers must be minimized as much as possible. The traditional method of displaying brief information of game objects performs a vertex buffer update, vertex buffer state setting, texture state setting, and a rendering instruction for each display information of each object. In this way, with the increase in the number of players displayed on the same screen, a large number of rendering state switches and rendering instruction operations are caused, seriously reducing the rendering ability of the rendering hardware and thus leading to a decrease in the game frame rate. Summary of the Invention

[0003] The present invention solves the problem that when the number of game objects displayed on the same screen is very large, the rendering state switching operation and the excessive number of rendering submissions caused by displaying the brief information of the objects lead to a sharp decline in the rendering performance of the game engine and a decrease in the game display frame rate. The specific solution is as follows:

[0004] A method for displaying brief information of 3D game objects, comprising the following steps:

[0005] S1: An object acquisition module acquires display objects and generates a list, traverses the object list, acquires the world coordinates of the virtual points for each object to display brief information and converts them to the coordinates in the current camera coordinate system, stores the acquired objects and the coordinate values in the camera coordinate system as data items in the list, generates a data list, and sorts the generated data list according to the depth values of the coordinate values;

[0006] S2: The vertex buffer management module clears the vertex buffer and traverses the sorted data list in S1. It obtains all the brief information that needs to be displayed for the object through object references.

[0007] S3: If the brief information to be displayed in S2 is text texture cache data, the text texture data cache module obtains texture coordinates from the text texture cache data, calculates the text vertex coordinate values, generates text rendering vertex data, and writes the generated vertex data to the vertex buffer management module.

[0008] S4: If the brief information to be displayed in S2 is icon set texture data, the icon set texture data module obtains texture coordinates from the icon set texture data, calculates the picture vertex coordinate values, generates picture rendering vertex data, and writes the generated vertex data to the vertex buffer management module.

[0009] S5: The vertex buffer management module sets the text texture rendering state according to the text rendering vertex data and sets the atlas texture rendering state according to the picture rendering vertex data.

[0010] S6: The rendering module renders the text texture and atlas texture in the vertex buffer management module.

[0011] Further, in step S1:

[0012] The object acquisition module generates a list of objects that are all visible in the current game window and have information to be displayed. The object acquisition module traverses all the game objects active on the client. If the object is within the visible range and has information to be displayed, it obtains the virtual point world coordinates used to display the brief information for each object and converts them to the coordinates in the current camera coordinate system. It stores the obtained object and the camera coordinate system coordinate values as data items in the list to generate a data list.

[0013] Further, in step S2:

[0014] The vertex buffer management module is used to manage the vertex buffer used in S1. It creates a vertex buffer with a default size at game startup and sets up the expansion strategy. When the number of display elements increases to the point where the current vertex buffer cannot meet the requirement, it destroys the current buffer and re-creates a larger vertex buffer according to the expansion strategy.

[0015] Further, in step S3:

[0016] The text texture data caching module first caches data according to the encoding value of the text, obtains the texture coordinates occupied by the text. If the acquisition fails, it uses the font rendering program to generate a text pixel image, then writes the pixel data into the text cache texture and calculates the texture coordinates according to the writing position. Finally, it uses the text encoding value as the key value to map the texture coordinates, generates text rendering vertex data, and writes the generated vertex data into the vertex buffer management module;

[0017] Further, in step S4:

[0018] The icon set texture data module stores all the icons displayed in the brief information onto a large texture, and generates corresponding icon names and texture coordinate mapping data.

[0019] Specifically, the present invention provides a display system for the brief information of 3D game objects, including an object acquisition module, a vertex buffer management module, a text texture data caching module, an icon set texture data module, and a rendering module;

[0020] The object acquisition module is used to acquire display objects and generate a data list. The vertex buffer management module is communicatively connected to the object acquisition module, and can traverse the data list of the object acquisition module, and obtain all the brief information that needs to be displayed by the object through object references. The text texture data caching module is communicatively connected to the vertex buffer management module, can cache the text texture cache data in the vertex buffer management module, and generate text rendering vertex data to be written into the vertex buffer management module. The icon set texture data module is communicatively connected to the point buffer management module, can cache the icon set texture data in the vertex buffer management module, and generate picture rendering vertex data to be written into the vertex buffer management module. The vertex buffer management module can set the text texture rendering state and the atlas texture rendering state according to the text rendering vertex data and the picture rendering vertex data. The rendering module is communicatively connected to the vertex buffer management module, and can render the text texture and the atlas texture in the vertex buffer management module.

[0021] The beneficial effects of the present invention are:

[0022] By generating the vertex data of all object brief information into a vertex buffer large enough to accommodate all the vertex quantities required for this frame; dynamically caching the text to be displayed in the brief information onto a texture; and making all the icons to be used in the brief information onto a large texture; these three main operations are used to complete the rendering of the brief information of all characters with only one vertex buffer. Only one vertex buffer needs to be updated per frame, the required hardware rendering state needs to be set once, and a rendering request needs to be submitted once, avoiding a large number of time-consuming buffer update, rendering state setting operations, and rendering requests. In this way, when the number of characters displayed on the same screen is very large, displaying the brief information of the characters only occupies very little rendering hardware resources, and the impact on the entire rendering system can be basically ignored. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 It is a flowchart of a method for displaying brief information of 3D game objects;

[0024] Figure 2 It is a schematic diagram of the connection of system modules for displaying brief information of 3D game objects. DETAILED DESCRIPTION OF THE INVENTION

[0025] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments.

[0026] As Figure 1 shown, a method for displaying brief information of 3D game objects includes the following steps:

[0027] S1: The object acquisition module acquires the display objects and generates a list, and traverses the object list to acquire the virtual point world coordinates of each object for displaying brief information and converts them into the coordinates of the current camera coordinate system. The acquired objects and camera coordinate system coordinate values are stored as data items in the list to generate a data list, and the generated data list is sorted according to the depth values of the coordinate values;

[0028] S2: The vertex buffer management module clears the vertex buffer and traverses the sorted data list in S1 to acquire all the brief information that needs to be displayed for the objects through object references;

[0029] S3: If the brief information to be displayed in S2 is text texture cache data, the text texture data cache module acquires the texture coordinates from the text texture cache data, calculates the text vertex coordinate values, generates the text rendering vertex data, and writes the generated vertex data to the vertex buffer management module;

[0030] S4: If the abbreviated information displayed in S2 is icon set texture data, the icon set texture data module obtains texture coordinates from the icon set texture data, calculates the vertex coordinate values of the picture, generates picture rendering vertex data, and writes the generated vertex data to the vertex buffer management module;

[0031] S5: The vertex buffer management module sets the text texture rendering state according to the text rendering vertex data, and sets the atlas texture rendering state according to the picture rendering vertex data;

[0032] S6: The rendering module renders the text texture and atlas texture in the vertex buffer management module.

[0033] In this step S1: The object acquisition module generates a list of objects that are all visible objects in the current game window and have information to be displayed. The object acquisition module traverses all game objects active on the client. If the object is within the visible range and has information to be displayed, it obtains the virtual point world coordinates of each object for displaying abbreviated information and converts them to the coordinates in the current camera coordinate system. The obtained object and the camera coordinate system coordinate values are stored as data items in the list to generate a data list;

[0034] In this step S2: The vertex buffer management module is used to manage the vertex buffer used in S1. At the start of the game, a vertex buffer with a default size is created and the expansion policy is set. When the number of display elements increases to the point where the current vertex buffer cannot meet the requirements, the current buffer is destroyed and a larger vertex buffer is recreated according to the expansion policy.

[0035] In this step S3: The text texture data cache module first caches data according to the encoding value of the text, obtains the texture coordinates occupied by the text. If the acquisition fails, it uses the font rendering program to generate a text pixel picture, then writes the pixel data to the text cache texture and calculates the texture coordinates according to the writing position. Finally, using the text encoding value as the key value, it maps the texture coordinates to generate text rendering vertex data, and writes the generated vertex data to the vertex buffer management module;

[0036] In this step S4: The icon set texture data module stores all the icons displayed in the abbreviated information on a large texture, and generates the corresponding icon name and texture coordinate mapping data.

[0037] As Figure 2 shown, a display system for abbreviated information of 3D game objects includes an object acquisition module, a vertex buffer management module, a text texture data cache module, an icon set texture data module, and a rendering module;

[0038] The object acquisition module is used to acquire display objects and generate a data list. The vertex buffer management module is communicatively connected to the object acquisition module and can traverse the data list of the object acquisition module, and obtain all the brief information required for display of the object through object references. The text texture data cache module is communicatively connected to the vertex buffer management module, can cache the text texture cache data in the vertex buffer management module, and generate text rendering vertex data to be written into the vertex buffer management module. The icon set texture data module is communicatively connected to the point buffer management module, can cache the icon set texture data in the vertex buffer management module, and generate picture rendering vertex data to be written into the vertex buffer management module. The vertex buffer management module can set the text texture rendering state and the atlas texture rendering state according to the text rendering vertex data and the picture rendering vertex data. The rendering module is communicatively connected to the vertex buffer management module and can render the text texture and the atlas texture in the vertex buffer management module.

[0039] In the above: By generating the vertex data of all object brief information into a vertex buffer large enough to accommodate all the vertex quantities required for this frame; Dynamically caching the text to be displayed in the brief information onto a texture; Making all the icons to be used in the brief information onto a large texture; These three main operations are used to complete the rendering of the brief information of all characters with only one vertex buffer. Only one vertex buffer needs to be updated, the required hardware rendering state needs to be set once, and a rendering request needs to be submitted once per frame, avoiding a large number of time-consuming buffer update, rendering state setting operations, and rendering requests. In this way, when the number of characters displayed on the same screen is very large, the display of the brief information of the characters only occupies very little rendering hardware resources, and the impact on the entire rendering system can be basically ignored.

[0040] In the description of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention.

[0041] It is obvious to those skilled in the art that the present invention is not limited to the details of the above-described exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be embraced within the present invention. Any reference signs in the claims should not be construed as limiting the claims involved.

Claims

1. A method for displaying brief information of a 3D game object, characterized in that, It includes the following steps: S1: The object acquisition module acquires display objects and generates a list, traverses the object list, acquires the virtual point world coordinates for each object to display the brief information and converts them into the coordinates in the current camera coordinate system, stores the acquired objects and the coordinate values in the camera coordinate system as data items in the list, generates a data list, and sorts the generated data list according to the depth values of the coordinate values; S2: The vertex buffer management module clears the vertex buffer and traverses the sorted data list in S1, and acquires all the brief information to be displayed for the object through object reference; Specifically, the vertex buffer management module is used to manage the vertex buffer used in S1, creates a vertex buffer with a default size at the startup of the game and sets the expansion strategy, destroys the current buffer when the number of display elements increases to a level that the current vertex buffer cannot satisfy and re-creates a larger vertex buffer according to the expansion strategy; S4: If the brief information displayed in S2 is text texture cache data, the text texture data cache module acquires the texture coordinates from the text texture cache data, calculates the text vertex coordinate values, generates text rendering vertex data, and writes the generated vertex data to the vertex buffer management module; Specifically, the text texture data cache module first caches data according to the encoding value of the text, acquires the texture coordinates occupied by the text. If the acquisition fails, it uses the font rendering program to generate a text pixel picture, then writes the pixel data to the text cache texture and calculates the texture coordinates according to the writing position. Finally, it uses the text encoding value as the key value to map the texture coordinates, generates text rendering vertex data, and writes the generated vertex data to the vertex buffer management module; S6: If the brief information displayed in S2 is icon set texture data, the icon set texture data module acquires the texture coordinates from the icon set texture data, calculates the picture vertex coordinate values, generates picture rendering vertex data, and writes the generated vertex data to the vertex buffer management module; S5: The vertex buffer management module sets the text texture rendering state according to the text rendering vertex data and sets the atlas texture rendering state according to the picture rendering vertex data; S6: The rendering module renders the text texture and the atlas texture in the vertex buffer management module.

2. The display method of the brief information of a 3D game object according to claim 1, wherein In step S1: The object acquisition module generates a list of all visible objects in the current game window that have information to be displayed. The object acquisition module traverses all the game objects active on the client side. If the object is within the visible range and has information to be displayed, it acquires the virtual point world coordinates for each object to display the brief information and converts them into the coordinates in the current camera coordinate system, stores the acquired objects and the coordinate values in the camera coordinate system as data items in the list, and generates a data list.

3. The display method of the brief information of a 3D game object according to claim 1, wherein In step S4: The icon set texture data module stores all the icons displayed in the brief information on a large texture, and generates the corresponding icon names and texture coordinate mapping data.

4. A display system for brief information of 3D game objects, characterized in that: The display system is used to execute the display method of the 3D game object summary information described in any one of claims 1-3, and includes an object acquisition module, a vertex buffer management module, a text texture data cache module, an icon set texture data module, and a rendering module; The object acquisition module is used to acquire display objects and generate a data list. The vertex buffer management module is communicatively connected to the object acquisition module, and can traverse the data list of the object acquisition module, and obtain all the summary information of the object to be displayed through object references. The text texture data cache module is communicatively connected to the vertex buffer management module, can cache the text texture cache data in the vertex buffer management module, and generate text rendering vertex data to be written into the vertex buffer management module. The icon set texture data module is communicatively connected to the point buffer management module, can cache the icon set texture data in the vertex buffer management module, and generate picture rendering vertex data to be written into the vertex buffer management module. The vertex buffer management module can set the text texture rendering state and the atlas texture rendering state according to the text rendering vertex data and the picture rendering vertex data. The rendering module is communicatively connected to the vertex buffer management module, and can render the text texture and the atlas texture in the vertex buffer management module.

Citation Information

Patent Citations

  • Method for pixel storage and rendering in game engine

    CN108196835A

  • An OSG-based mass text rendering method

    CN109215103A

  • User interface rendering method

    CN111330270A