Object rendering method and device, computing equipment, storage medium and program product
By obtaining the character position in the virtual scene, determining the rendering block and cache block, caching only a fixed amount of data, and updating the cache block position according to the character position, the problem of uneven rendering in large or high-precision scenes is solved, achieving efficient rendering and a smooth virtual scene experience.
Patent Information
- Application Number
- CN202510826754.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-09-23
AI Technical Summary
When loading and rendering virtual scenes, existing technologies incur huge memory and processor overhead when facing large or high-precision scenes, resulting in an unsmooth rendering process and affecting the user experience.
By obtaining the position of the target character, determining the rendering block and cache block, only caching a fixed amount of object data, updating the cache block position according to the character position, reducing the amount of traversal data, and only rendering the data in the rendering block.
It reduces rendering delay and overhead, ensures the smoothness of virtual scenes, and improves user experience.
Smart Images

Figure CN120689482A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of animation rendering technology, and more particularly to an object rendering method, an object rendering apparatus, a computing device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the development of Internet technology, the content of virtual scenes is becoming more and more abundant, and the size and precision of virtual scenes are also constantly improving. When loading and rendering these virtual scenes, all the data in the scene needs to be cached and submitted to the engine. If the scene content changes, all the data in the scene must be re-traversed for each change to complete the rendering. If the scene is too large or the precision is too high, the memory and processor overhead will be very huge, and the traversal time will also increase sharply, which will lead to the loading and rendering process of the virtual scene not being smooth enough, or even stuck or flashing back, affecting the user experience. Summary of the Invention
[0003] In view of this, embodiments of the present application provide an object rendering method to address the technical deficiencies in the prior art. Embodiments of the present application also provide an object rendering apparatus, a computing device, a computer-readable storage medium, and a computer program product.
[0004] According to a first aspect of an embodiment of the present application, there is provided an object rendering method, comprising: Get the target character's position; Determining a rendering block according to the position of the character, wherein the rendering block is used to record object data of a target object to be rendered in a target scene, the object data recorded by the rendering block is determined based on object data cached by a cache block and character information of the target character, the cache block is used to cache the object data of the target object in the target scene, and the cache block includes the rendering block; Rendering the target object to be rendered according to the object data recorded by the rendering block.
[0005] According to a second aspect of an embodiment of the present application, there is provided an object rendering apparatus, comprising: An acquisition module, configured to acquire a role position of a target role; a determination module configured to determine a rendering block according to the position of the character, wherein the rendering block is used to record object data of a target object to be rendered in a target scene, the object data recorded by the rendering block is determined based on object data cached by a cache block and character information of the target character, the cache block is used to cache the object data of the target object in the target scene, and the cache block includes the rendering block; The rendering module is configured to render the target object to be rendered according to the object data recorded by the rendering block.
[0006] According to a third aspect of an embodiment of the present application, there is provided a computing device, including: a memory and a processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the above-mentioned object rendering method is implemented.
[0007] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program / instruction, and the computer program / instruction implements the above-mentioned object rendering method when executed by a processor.
[0008] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising a computer program / instruction, which implements the above-mentioned object rendering method when executed by a processor.
[0009] In the object rendering method provided by the present application, the character position of the target character is obtained, and based on the character position, a rendering block that records the object data of the target object to be rendered in the target scene and a cache block that contains the rendering block and caches the object data of the target object are determined, and the target object to be rendered is rendered according to the object data recorded in the rendering block. In the present application, the cache block only caches a fixed amount of object data, so that the consumption of memory and processor is always within a fixed range and is not changed by changes in scene accuracy and size. The rendering block contained in the cache block is determined based on the character position, and the target object to be rendered is rendered according to the object data recorded in the rendering block, so that each rendering only needs to traverse the object data recorded in the rendering block, reducing the time and overhead of traversal. At the same time, the rendering block is determined based on the target character position, so that the rendered picture content can accurately meet the user's needs. As a result, when the size and accuracy of the virtual scene are increased, all the pictures required by the user can be rendered, and the smoothness of the scene loading and rendering process is guaranteed, avoiding delays or freezes, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Figure 1 This is a structural diagram of an object rendering method provided by an embodiment of the present application; Figure 2 This is a flowchart of a method for updating cache block data provided by an embodiment of the present application; Figure 3 This is a flowchart of a method for updating a cache block location provided by an embodiment of the present application; Figure 4This is a flowchart of a method for copying intersecting area data provided by an embodiment of the present application; Figure 5 This is a flowchart of a method for updating cache data provided by an embodiment of the present application; Figure 6 This is a flow chart of a method for determining displacement intersection provided by an embodiment of the present application; Figure 7 This is a flowchart of a coordinate system conversion method provided by an embodiment of the present application; FIG8( a ) is a flowchart of an embodiment of snow virtual scene optimization in the present application; FIG8( b ) is a schematic diagram of cache block position coordinates in an embodiment of the snow virtual scene optimization of the present application: FIG8( c ) is a schematic diagram of a rendering block moving to the edge of a cache block in an embodiment of snow virtual scene optimization of the present application; FIG8( d ) is a schematic diagram of the cache block position after being updated in the embodiment of the snow virtual scene optimization of the present application; FIG8( e ) is a schematic diagram of the intersection area of new and old cache blocks in an embodiment of the snow virtual scene optimization of the present application; Figure 9 This is a schematic structural diagram of an object rendering device provided by an embodiment of the present application; Figure 10 This is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0011] The following description sets forth many specific details to facilitate a thorough understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of the present application. Therefore, the present application is not limited to the specific implementations disclosed below.
[0012] The terms used in one or more embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0013] It should be understood that although the terms "first," "second," and the like may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, "first" may also be referred to as "second," and similarly, "second" may also be referred to as "first," without departing from the scope of one or more embodiments of the present application.
[0014] First, the terms involved in one or more embodiments of the present application are explained.
[0015] Cache block: composed of grids, it is the unit for storing data in the cache. The grid is the smallest unit for storing data in the cache, and its physical storage is abstracted as a two-dimensional array. The amount of data stored in the grid and the number of grids contained in the cache block can be predetermined based on user needs, the hardware memory configuration of the user's computer, the precision parameters in the virtual scene, etc. The data stored in the cache block is the data corresponding to the digital environment of the entire virtual scene or part of the virtual scene.
[0016] Render Block: A subset of a cache block that records the portion of the object data in the cache block to be rendered. The object data recorded by the render block will be submitted to the engine for rendering. In the specific implementation process, the data recorded by the render block corresponds to the location of the rendered area in the target scene in a logical sense. The data recorded by the render block comes from the cache block.
[0017] Global Coordinate System: refers to a single, unified reference system used to describe the entire target scene space and the positions of all objects therein (including target characters, render blocks, cache blocks, scene elements, etc.).
[0018] Cache coordinate system: refers to a local reference system temporarily defined or associated to describe the location and range of a specific cache block and the data it contains (such as terrain, textures, models, tiles) in space.
[0019] Unity Engine: A cross-platform game engine and development environment. It provides core tools and features that simplify the creation, deployment, and operation of 2D and 3D games and interactive experiences (such as simulations, film, and television). It is particularly known for its ease of use and support for multi-platform publishing.
[0020] Maya (AutodeskMaya) engine: a professional-grade 3D computer graphics software mainly used for high-precision modeling, animation, simulation and rendering.
[0021] At present, in virtual scenes, especially in electronic game scenes, the pictures displayed on the player's device are often not the entire area of the virtual game scene, and the player's field of view is also limited. The details of the distant environment often do not need to be paid attention to. However, when facing the needs of loading and rendering such virtual scenes, the existing technology will still cache all the data in the scene and submit it to the engine. If the scene content changes, including changes in distant details that the player does not need and will not pay attention to, but every change in the existing technology requires all the data in the scene to be re-traversed before rendering is completed. In this way, the memory and processor overhead will be very huge due to the loading and rendering of a lot of unnecessary data, and the traversal time will also increase sharply, which will lead to the loading and rendering process being not smooth enough, greatly affecting the user experience.
[0022] In response to the above problems, this application proposes a rendering block that records the data of the scene to be rendered based on the character's position and a cache block containing the object data in the cache target scene of the rendering block. The data size stored in the cache block is pre-fixed, and a method is used to render the target object to be rendered based on the object data recorded in the rendering block.
[0023] Based on the above inventive concepts, this application provides an object rendering method. One or more embodiments of this application also involve an object rendering method, an object rendering apparatus, a computing device, a computer-readable storage medium, and a computer program product, each of which is described in detail in the following embodiments.
[0024] See also Figure 1 , Figure 1 A structural diagram of an object rendering method provided according to an embodiment of the present application is shown, which specifically includes the following steps.
[0025] Step 102: Get the role position of the target role.
[0026] The embodiments of this application are applicable to electronic devices such as mobile terminals, computers, and servers. The processor in the electronic device calculates and processes the data involved in the first two steps of this embodiment, and the rendering engine in the electronic device is responsible for rendering the data in the rendering block of this embodiment. The rendering engine performing graphics rendering in this embodiment includes, but is not limited to, the Unity development engine, the Unreal Engine development engine, the Maya development engine, etc. This embodiment of the application does not specifically limit this.
[0027] A target character is a computer-generated entity in a target scene that exists within a digital environment and serves a specific purpose or is observed by a specific subject, such as a user or system. Interaction refers to the ability to interact with the target scene itself or other entities within it. A target character can move or change according to pre-set program logic. For example, in a virtual game scene, a target character can be a virtual character controlled by a player, a non-player character driven by a computer program that interacts with the player-controlled virtual character, or an object or prop in the virtual game scene. In virtual animation scenes, including but not limited to virtual driving scenes, virtual construction scenes, and virtual experiment scenes, a target character can be a human character, an animal, a vehicle, a ship, an airplane, a building component, a landscape component, a weather component, a chemical substance in a virtual experiment, a molecule in a virtual experiment, or a circuit component in a virtual experiment.
[0028] A character's position refers to object parameters, configuration table parameters, component data, and the results of spatial transformation calculations that represent the target character's position within a digital environment representing the target scene. For example, the coordinates of a virtual character's skeleton within the virtual scene's global coordinate system; when the target scene is composed of multiple units, the position of the unit containing the target character relative to the entire scene; from a data storage perspective, the target scene's data is stored in multiple minimum storage units, and the character's position can be the position within the target scene corresponding to the grid where data changes are caused by the target character's interaction with other entities in the target scene or the target scene itself; and so on.
[0029] Exemplarily, the acquisition method may be to identify the scene image captured in the target scene, identify the target character therein, and use a position recognition algorithm (such as a neural network algorithm) to determine the position of the target character in the scene image. The global coordinate system of the scene may be constructed or a local coordinate system may be constructed with the position of a unit in the scene as the origin. The coordinates of the target character in the coordinate system may be determined based on the constructed coordinate system and the position of the target character in the scene image, thereby determining the role position of the target character.
[0030] Exemplarily, the acquisition method may be to determine the data grid occupied by the target character in the data structure at the data level, determine the area in the target scene corresponding to the data grid, calculate the geometric center of the area, and use the grid closest to the geometric center of the area as the character position of the target character.
[0031] Exemplarily, a global coordinate system or a local coordinate system of the target scene is constructed, the data grid occupied by the target character in the data structure is determined at the data level, the area in the target scene corresponding to the data grid is determined and the geometric center of the area is calculated, the coordinates of an endpoint of the grid closest to the geometric center of the area in the constructed coordinate system are determined, and the coordinates are used as the character position of the target character.
[0032] Obtaining the target character's position provides a basis and foundation for subsequently determining the rendering block and the object data of the target object in the target scene to be cached and rendered.
[0033] Step 104: Determine a rendering block based on the character position, wherein the rendering block is used to record object data of a target object to be rendered in the target scene, the object data recorded by the rendering block is determined based on the object data cached by the cache block and the character information of the target character, the cache block is used to cache the object data of the target object in the target scene, and the cache block includes the rendering block.
[0034] The target scene is a virtual scene, a digital environment created for computer graphics, virtual reality, augmented reality, and other related technologies. Target scenes can be categorized into various types based on their application areas, including three-dimensional virtual game scenes in game development, two-dimensional virtual scenes in game development, virtual animation scenes in animation design, virtual architectural scenes in architectural design and engineering, virtual driving scenes in education and training, and virtual experimental scenes in scientific research. The target scene includes scene elements such as scene objects and scene backgrounds. Scene objects can be any interactive element, such as game characters, objects, and environmental components. Scene backgrounds can be non-interactive elements of the scene, such as environment maps. Scene data refers to the element parameters of each scene element in the target scene, including but not limited to: the size of scene objects, their position, their texture, their material, the type and position of scene lighting, the intensity of the light source, the position of the scene background, the texture of the scene background, and the size of the scene background. For example, in game development, the target scene is a game map scene, which includes scene objects such as snow, mountains, woods, waters, buildings, and characters, scene lighting of sunlight, and scene background of the sky. Among them, scene objects such as snow, mountains, woods, waters, buildings, and characters have corresponding element parameters such as size, position, texture, and material.
[0035] The target object is the element in the target scene that needs to be cached. Target objects can be elements in video game scenes, virtual building scenes, or virtual experiment scenes. For example, elements in parts of a video game scene include terrain features, snowflakes, leaves, other characters, items, and props. Video game scenes can be third-person video games, first-person video games, or sandplay games with different levels. Parts of the scene can be square areas centered on a specific game character, areas calculated based on a specific character's perspective, sandplay game levels, etc. Target objects can also include elements on a floor or in a room in a virtual building scene, electronic components in a simulated circuit system in a virtual experiment scene, and organs and tissue elements in a virtual human body structure.
[0036] A cache block is composed of grids, a fixed-size cache area within the hardware cache that stores data. A grid is the smallest unit for storing and managing data within the hardware cache, and its physical storage is abstracted as a two-dimensional array. Therefore, a cache block is essentially a two-dimensional array, representing an area within the hardware cache. A cache block corresponds to a portion of the virtual scene. The data stored in a grid and the number of grids within a cache block can be predetermined based on user needs, the user's computer's hardware memory configuration, and the precision parameters of the virtual scene. The data stored in a cache block corresponds to the portion of the target scene to be cached. Because the data stored in a cache block is pre-fixed, it is decoupled from subsequent changes in virtual scene size and precision. Therefore, regardless of changes in scene precision and size, the memory consumed by the cached data remains fixed.
[0037] A rendering block is a subset of a cache block, recording the portion of object data in the cache block to be rendered. This object data recorded by the rendering block will be rendered by the rendering engine. In a specific implementation, the data recorded by the rendering block corresponds to the logical location of the rendered area in the target scene, and the data recorded by the rendering block comes from the cache block. During the rendering process, traversing and submitting only the data recorded by the rendering block is much faster than traversing the entire target scene and then submitting the data, and overhead is significantly reduced. Moreover, since the rendering block is a subset of the cache block, the data to be rendered is already cached, which significantly reduces rendering latency. For example, when rendering a virtual scene related to snow interaction, the virtual scene data is composed of grids, and snow block data is stored in the grids. When interaction occurs, such as when the foot bones of a virtual character come into contact with the snow, the snow block data in the corresponding grid changes. The rendering block records the data occupied by the grids in the area to be rendered. When the data of certain grids in the area to be rendered changes, the data recorded by the rendering block also changes, and the rendering of the changed data is performed in conjunction with the data submission and rendering process. Because the object data recorded in the rendering block comes from the cache block, the change of the object data recorded in the rendering block is also the change of the object data cached in the cache block.
[0038] For example, in an interactive scene with a virtual water surface, the water surface is composed of water wave units (grids), and the data of the water surface is stored in the grids. When an interaction occurs, such as when the skeleton of a virtual character comes into contact with the water surface, the data in the corresponding water wave units will also change. When the interactive behavior occurs in the area corresponding to the data to be rendered recorded by the rendering block, the data recorded by the rendering block will also change, and then the rendering of the data will be executed in conjunction with the process of submitting the data for rendering.
[0039] For example, in a virtual experimental scenario, such as the titration process of liquid in a test tube, the test tube is composed of vertical layered units, and each vertical layered unit stores data such as liquid component concentration, temperature, and pH value. When interacting with the liquid in the test tube, such as adding reagents to change the visual effect of the liquid, there are layered liquids in the test tube, and different liquids are incompatible with each other and will not interact, such as in the case of water and oil stratification, the target role can be set to water, and the rendering block can be configured to only record the area where the layered unit corresponding to the water is located. When water participates in a chemical reaction, the unit data of the corresponding area changes, that is, the data recorded by the rendering block will also change, and then the rendering of the data will be executed in conjunction with the process of submitting the data for rendering.
[0040] Determining rendering blocks based on the character's position allows rendering blocks capable of rendering fixed-size data to accurately record the data being rendered, thereby ensuring a consistent user visual experience. For example, in a third-person video game scene, this determination method can be to obtain the coordinates of the player's character in the target scene, determine the rendering blocks that record the object data corresponding to the area to be rendered based on the coordinates, and ensure that the rendering blocks always follow the player's character's movements, thereby ensuring that the virtual scene surrounding the player is always rendered.
[0041] Exemplarily, the target character may be a snow block, liquid, etc. For example, when the target character is a snow block or a water wave unit, and the scene is a virtual scene interacting with snow or water, the determination method may be to detect the corresponding unit where data changes occur through flag detection or hash value algorithm, and position the rendering block on the unit and then perform the rendering operation, so that the changed elements can always be rendered.
[0042] For example, in an electronic game scene that emphasizes interactive actions, the target grid corresponding to the data change caused by the target character's interaction with other entities in the target scene or the target scene itself can be obtained. Then, based on the target grid's position, the information of the grid corresponding to the data to be rendered is determined, and the rendering block is determined so that the interactive behavior can always be rendered; the object data recorded in the rendering block is determined based on the object data cached in the cache block and the character information of the target character. The setting of the rendering block and the cache block can ensure that memory and processor consumption are always within a fixed range and are not affected by changes in scene accuracy and size. In subsequent rendering, only the data recorded in the rendering block needs to be traversed, reducing rendering delay and overhead.
[0043] Step 106: Render the target object to be rendered according to the object data recorded by the rendering block.
[0044] In the embodiment of the present application, by setting up a cache block that only caches a fixed amount of data, memory and processor consumption are always kept within a fixed range and are not affected by changes in scene accuracy and size. The rendering block contained in the cache block is determined based on the character position information, and the target object to be rendered is rendered based on the object data recorded in the rendering block. Therefore, each rendering only needs to traverse the data recorded in the rendering block, reducing the time and cost of traversal without affecting the visual effect. As a result, when the accuracy and size of the virtual scene are increased, the smoothness of the scene loading and rendering process is guaranteed without affecting the visual effect, avoiding delays or freezes, and improving the user experience.
[0045] However, there are still problems in the above implementation process, that is, the position of the cache block corresponding to the target scene is fixed, and the cache block only caches a part of the data corresponding to the target scene. Because the rendering block is a subset of the cache block, the above solution is insufficient when facing the situation where the rendering area needs to change over a large range. A technical solution is urgently needed to solve this problem.
[0046] In response to the above problems, this application provides a method for updating cache block data by updating the position of the cache block in the target scene corresponding to the cache block, so as to achieve the technical effect of rendering any area in the target scene while fixing the memory consumption required for the cache and reducing the amount of data traversed during rendering. This is described in detail in the following embodiments.
[0047] See also Figure 2 , Figure 2 A flowchart of a method for updating cache block data provided according to an embodiment of the present application is shown, which specifically includes the following steps.
[0048] Step 202: Determine the rendering block position corresponding to the rendering block in the target scene according to the character position, and obtain the current cache block position corresponding to the cache block in the target scene.
[0049] The rendering block position corresponding to the rendering block is the position of the corresponding area to be rendered in the target scene. Exemplarily, the rendering block position corresponding to the rendering block in the target scene is determined based on the character position, and the character's coordinates in the target scene can be used as the character position, and the coordinates can be used as the rendering block position corresponding to the rendering block; when the character position is the position in the target scene corresponding to the target grid whose data changes due to the target character interacting with other entities in the target scene or the target scene itself, the rendering block position corresponding to the rendering block can be the position in the target scene corresponding to the target grid; when the character position is a coordinate, the rendering block position corresponding to the rendering block can also be the position corresponding to the grid corresponding to the coordinate.
[0050] Obtaining a current cache block position corresponding to a cache block in the target scene. The current cache block position may be a pre-set initial position in the target scene, or may be an area in a virtual scene centered around the target character's position. In one embodiment of the present application, the current cache block position may be an updated cache block position after a cache update was last triggered.
[0051] Step 204: when the cache block cache update is triggered according to the rendering block position and the current cache block position, determine an updated cache block position corresponding to the cache block based on the rendering block position.
[0052] For example, the rendering block may be moved to the edge of the cache block, and real-time edge overlap detection may be performed on the rendering block and the cache block. When it is detected that the edge of the rendering block overlaps with the edge of the cache block, a cache update of the cache block is triggered.
[0053] For example, if the rendering block has moved outside the cache, convert the rendering block's position (in the global coordinate system) to a cache coordinate system position (rx, ry). Obtain the rendering block's width (rw) and height (rh), and set the cache block's boundaries: 0 <= x <= cache_width, 0 <= y <= cache_height. If rx < 0 or rx + rw > cache_width or ry < 0 or ry + rh > cache_height, the rendering block has moved outside the cache, triggering a cache update for the cache block.
[0054] For example, if the distance difference between the center position corresponding to the rendering block and the center position corresponding to the cache block is greater than a preset threshold, a cache update of the cache block is triggered.
[0055] For example, a deviation between the center position of the rendering block and the center position of the cache block may trigger a cache update of the cache block. This approach can ensure that the rendering block is always in the center area of the cache block.
[0056] Based on the rendering block position, an update cache block position corresponding to the cache block is determined. Specifically, the update cache block position may be equal to the rendering block position, that is, the rendering block position is at the center of the cache area in the target scene corresponding to the cache block, or is a preset distance away from the rendering block position.
[0057] Exemplarily, the updated cache block center position is set to the center position corresponding to the current rendering block, and the position is determined in the form of coordinates, that is, the coordinates corresponding to the cache block center position are adjusted to the coordinates corresponding to the rendering block center position.
[0058] Step 206: According to the updated cache block position, the object data of the target object cached in the cache block is updated.
[0059] Exemplarily, after determining the location of the updated cache block, the cache is cleared first, and then the grids included in the updated cache block are determined, and the data stored in the corresponding grids are cached.
[0060] Specifically, the updated cache block position can be the center position of the area corresponding to the target object in the target scene. The size of the cache area corresponding to the updated cache block is determined based on the size of the fixed cache data corresponding to the cache block and the accuracy and size of the virtual scene. Based on the center position and the cache area size, the object data of the target object to be cached by the updated cache block is determined and updated.
[0061] Step 208: Based on the updated object data cached in the cache block and the role information of the target role, determine the object data of the target object to be rendered recorded by the rendering block.
[0062] Based on this, by determining the rendering block position corresponding to the rendering block in the target scene according to the role position of the target character, and obtaining the current cache block position corresponding to the cache block in the target scene, and updating the cache block position and the data in the cache block according to the rendering block position and the current cache block position, and then determining the object data of the target object to be rendered recorded by the rendering block according to the updated cache block data and the role information of the target character, it is possible to achieve the technical effect of rendering any area in the target scene while fixing the memory consumption required for the cache and reducing the amount of data traversed during rendering.
[0063] However, although the above method can load and render any area in the target scene, it requires a position update method for updating the cache block position corresponding to the cache block according to the rendering block position corresponding to the rendering block, to ensure that the rendering block position is as close as possible to the area corresponding to the object data of the target object cached by the cache block, so that when the rendering data is constantly changing, the data to be rendered can still be cached as much as possible, thereby improving the rendering efficiency.
[0064] See also Figure 3 , Figure 3 A flowchart of a method for updating a cache block location according to an embodiment of the present application is shown, which specifically includes the following steps.
[0065] Step 302: Identify the current relative position of the rendering block and the cache block according to the rendering block position and the current cache block position.
[0066] Based on the rendering block position and the current cache block position, the current relative position of the rendering block and the cache block is identified. Specifically, the relative position is a distance relationship derived from information about the rendering block position and the current cache block position. For example, the relative position may be the distance relationship between the coordinates corresponding to the current cache block position in the target scene and the coordinates corresponding to the rendering block position in the target scene, the coordinates corresponding to the edge of a cache area determined by the size of the fixed cache data corresponding to the current cache block and the accuracy and size of the virtual scene, or the relative position may be the distance relationship between the coordinates corresponding to the edge of the cache area and the coordinates corresponding to the rendering block position.
[0067] Step 304: When the current relative position meets a preset movement condition, triggering the cache block cache update.
[0068] The preset movement condition may be that the distance relationship corresponding to the relative position satisfies certain conditions or reaches a preset threshold, for example, the rendering block position reaches the edge of the cache area corresponding to the current cache block, the rendering block position deviates from the current cache block position, the distance between the rendering block position and the cache block position is greater than a specific distance parameter, etc.
[0069] Based on this, by identifying the current relative positions of the rendering block and the cache block and setting preset movement conditions to detect whether the cache block should be updated, the rendering block position is ensured to be as close as possible to the area corresponding to the object data of the target object cached by the cache block. This ensures that when the rendering data is constantly changing, the data to be rendered can still be cached as much as possible, thereby improving the rendering efficiency.
[0070] Figure 4 A flowchart of a method for copying intersection area data provided according to an embodiment of the present application is shown, which specifically includes the following steps.
[0071] Step 402: Identify whether there is an intersection between the displacements corresponding to the cache blocks according to the current cache block position and the updated cache block position; Identifying whether there is an intersection of displacements corresponding to the cache blocks is to determine whether there is an intersection area between the position corresponding to the current cache block and the position corresponding to the updated cache block. The identification process can be implemented by a computer program.
[0072] Step 404: In the case of displacement intersection, based on the current cache block position, copy the object data in the intersecting area of the cache block to a temporary array, and clear the object data cached in the cache block.
[0073] When there is a displacement intersection, that is, when there is an intersecting area between the position corresponding to the current cache block and the position corresponding to the updated cache block, the object data of the target object corresponding to the intersecting area is copied to a temporary array, and the object data cached in the cache block is cleared.
[0074] Step 406: Based on the updated cache block position, the object data in the temporary array is sequentially cached to the intersection area of the cache block, and the object data in the target scene is correspondingly written to the remaining cache area of the cache block.
[0075] Based on this, by copying the object data of the target object corresponding to the intersecting area to a temporary array, and then caching the object data in the temporary array in sequence to the intersecting area of the cache block, it can be ensured that the character information of the target character within a certain range will not be lost when the cache block cache data is updated, and memory consumption can be effectively saved.
[0076] Figure 5 A flowchart of a method for updating cache data provided according to an embodiment of the present application is shown, which specifically includes the following steps.
[0077] Step 502: when there is no displacement intersection, clear the object data cached in the cache block; Step 504: Based on the updated cache block position, write the object data in the target scene into the cache block accordingly.
[0078] In the case where there is no displacement intersection, that is, when there is no intersection between the position corresponding to the updated cache block and the position corresponding to the current cache block, the data stored in the cache block is directly cleared, and the new object data is written into the updated cache block according to the position. This can effectively update the cache data as the cache position is updated, so that the physical storage can complete effective information interaction with the characters and areas in the logical scene.
[0079] but, Figure 4 and Figure 5 Although the above embodiment can effectively solve the technical problems of how to update the cache block according to the rendering block position and how to record character information and save memory consumption, the above embodiment cannot effectively solve the problems of how to determine whether the updated cache block and the current cache block intersect and how to determine the intersection area.
[0080] In order to solve the technical problem of determining whether the updated cache block and the current cache block intersect and determining the intersection area, Figure 6 A flow chart of a method for determining displacement intersection according to an embodiment of the present application is shown, which specifically includes the following steps: Step 602: Determine the initial endpoint information and the update endpoint information of the cache block according to the current cache block position and the update cache block position.
[0081] Specifically, the initial endpoint information is the endpoint coordinates of the current cache area determined by the current cache block position and cache block size; the update endpoint information is the endpoint coordinates of the update cache area determined by the update cache block position and cache block size.
[0082] For example, the upper and lower endpoint coordinates of the current cache area and the updated cache area may be determined, and the upper and lower endpoint coordinates of the intersection area may be determined based on the upper and lower endpoint coordinates of the current cache area and the updated cache area.
[0083] For example, the left and right endpoint coordinates of the current cache area and the updated cache area may be determined, and the left and right endpoint coordinates of the intersection area may be determined based on the left and right endpoint coordinates of the current cache area and the updated cache area.
[0084] Step 604: Determine the change distance corresponding to the cache block according to the initial endpoint information and the update endpoint information.
[0085] For example, the distance difference between the left and right endpoints of the intersection area is calculated, and the difference is used to represent the change distance. For example, the distance difference between the upper and lower endpoints of the intersection area is calculated, and the difference is used to represent the change distance. Step 606: Based on the change distance, identify whether there is an intersection of displacements corresponding to the cache blocks.
[0086] For example, based on the positive and negative attributes of the horizontal coordinates of the left and right endpoints of the intersection area, if the difference between the horizontal coordinates of the left endpoint and the right endpoint of the intersection area is greater than 0, it is determined that there is no displacement intersection, otherwise it is determined that there is displacement intersection.
[0087] For example, based on the positive and negative attributes of the horizontal coordinates of the upper and lower endpoints of the intersection area, if the difference between the horizontal coordinates of the lower endpoint and the upper endpoint of the intersection area is greater than 0, it is determined that there is no displacement intersection, otherwise it is determined that there is displacement intersection.
[0088] Based on this, by determining the endpoint information of the updated cache block and the current cache block, the change distance corresponding to the cache block is determined, and the displacement intersection corresponding to the cache block is determined according to the change distance. This can effectively determine whether there is an intersection area between the updated cache block and the current cache block, thereby solving the technical problem of determining whether the updated cache block and the current cache block intersect and determining the intersection area.
[0089] Figure 7A flowchart of a coordinate system conversion method provided according to one embodiment of the present application is shown, which solves the problems caused by inconsistent coordinates between the positions mentioned in the above embodiment during calculation and processing. The method specifically includes the following steps: Step 702: Determine the global coordinate system corresponding to the target scene and the cache coordinate system corresponding to the cache block.
[0090] Specifically, in the cache coordinate system corresponding to the cache block, the origin position may be the cache block position, or may be each end position of the cache area in the target scene determined according to the cache block position and cache block size.
[0091] Step 704: Construct a conversion relationship between the global coordinate system and the cache coordinate system, wherein the conversion relationship is used to convert the character position of the target character, the rendering block position corresponding to the rendering block, and the cache block position corresponding to the cache block to the same coordinate system.
[0092] Exemplarily, the way to convert global coordinates into cached coordinates can be to use the coordinate translation method, that is, the difference between the global coordinates of the target object to be converted and the global coordinates of the origin of the cached coordinate system is used as the cached coordinates of the target object. Similarly, this method is also applicable to the conversion of cached coordinates into global coordinates.
[0093] Exemplarily, the way to convert global coordinates into cache coordinates can be to use the offset vector method, that is, to calculate the offset vector between the cache coordinate system and the global coordinate system, and use the sum of the coordinates of the target object in the global coordinate system and the offset vector as its coordinates in the cache coordinate system. Similarly, this method is also applicable to converting cache coordinates into global coordinates.
[0094] Based on this, by unifying the target character's position, the rendering block position corresponding to the rendering block, and the cache block position corresponding to the cache block in one coordinate system, it is convenient to perform boundary validity checks and judge and calculate the relationship between positions.
[0095] FIG8( a ) shows a flowchart of steps for optimizing a virtual snow game scene in an embodiment. The target character is a character controlled by a player from a third-person perspective. The target scene is a virtual game scene with a square area of a meter side and dominated by snow. Every 1 meter is divided into nRate data grids. A data grid is a grid that makes up a cache block and is the smallest unit for storing data in the cache. Its physical storage is abstracted as a two-dimensional array. In this embodiment, the grid is used to store snow status data. A 1×1 meter square area contains nRate × nRate independent snow data grids.
[0096] Step 802: Data preprocessing: Define the logical data range: Define the logical length as nLogicLength. Based on the above information, the total amount of snow data in the entire scene is nLogicLength × nLogicLength grids. The calculation formula is: nLogicLength = a × nRate. For example, if the scene is 100×100 meters and the precision is defined as 32, then 1 meter contains 32 data grids, resulting in a logical length of 3200×3200 grids.
[0097] Define cache blocks: As shown in Figure 8(b), a cache block is a square two-dimensional array with a side length of nCacheLength, which is used to store the snow data in this embodiment. The length of nCacheLength is pre-fixed to a constant value, so the memory usage is also always a constant value, achieving decoupling from the scene size and precision. For example, if the length of nCacheLength is pre-fixed to 512, then when the precision is 16, the cache block covers an area of 512×512 meters (8192 / 16=512), and when the precision is 32, the cache block covers an area of 256×256 meters (8192 / 32=256). The cache center coordinates are defined as (nCacheX, nCacheY), which are the coordinates of the data grid to the upper left of the area center of the cache block, and are used to represent the position of the cache block in the global logical coordinate system.
[0098] Define a render block: A render block is a square area with a side length of nRenderLength cells and is a subset of a cache block. In this embodiment, a render block is a square area with a side length of nCacheLength / 2 cells of the cache block. This area is used to store the data to be rendered in the cache block. Only data within the render block is submitted to the engine. In this embodiment, the side length of the render block is half the side length of the cache block. The center coordinates of the render block are (nRenderX, nRenderY), which are configured to be determined by the position of the player's virtual character and always equal to the logical coordinates of the player's current position. When the player controls the virtual character to move, the render block will move with it.
[0099] Step 804: Coordinate transformation: Define the global logical coordinates: the lower left corner of the scene is the origin (0,0), and the upper right corner is (nLogicLength-1,nLogicLength-1).
[0100] Define the cache local coordinates: the lower left corner of the cache rectangle is the origin (0,0), and the upper right corner is (nCacheLength-1, nCacheLength-1).
[0101] Logical coordinate conversion cache coordinates: input global logical coordinates (nXLogicIndex, nYLogicIndex); Cache X coordinate = nXLogicIndex + nCacheLength / 2 - nCacheX; Cache Y coordinate = nYLogicIndex + nCacheLength / 2 - nCacheY; Among them, nCacheX, nCacheY are taken from the cache center coordinates (nCacheX, nCacheY).
[0102] Validity Check: If the calculated result exceeds the range [0, nCacheLength-1], a failure is returned. When the character moves, the global logical coordinates corresponding to the footsteps are calculated, converted to cache coordinates, and the point is checked to see if it is within the cache rectangle. If so, the state of the corresponding snow grid in the cache rectangle is updated, such as if the footprint is sunken. If not, the update is skipped. If the player is the protagonist, the cache movement check is called, and if movement is required, the cache rectangle is migrated.
[0103] Similarly, cache coordinates can also be converted into their corresponding logical coordinates using the above method.
[0104] Step 806: Cache block update determination: As shown in Figure 8(c), in the coordinate system, the rectangle containing the lower right slanted stripes is the rendering block, and the rectangle containing the upper right slanted stripes is the cache block. When the player's movement causes the deviation between the center position of the rendering block (nRenderX, nRenderY) and the center position of the cache block (nCacheX, nCacheY) to exceed the threshold, the cache block position update is triggered. In this embodiment, the threshold is set to half the length of the rendering block, that is, nRenderLength / 2. When |nRenderX - nCacheX|>= nRenderLength / 2 or |nRenderY - nCacheY|>= nRenderLength / 2, the cache block position update is triggered. The updated cache block is shown in Figure 8(d).
[0105] Step 808: Cache block update algorithm: As shown in Figure 8(e), when the original cache block intersects with the existing cache block, the dark-colored data in the middle needs to be copied to the new cache block: Calculate the intersection area of the new and old cache blocks: Horizontal intersection range: Define the X subscript of the left endpoint of the intersection area of the new and old caches = max(0, nCacheX -nNewCacheX); the X subscript of the right endpoint of the intersection area of the new and old caches = min(nCacheLength-1, nCacheLength-1 +nCacheX - nNewCacheX), which is the minimum value of the two; Vertical intersection range: Define the Y subscript of the lower end of the intersection area of the new and old caches = max(0, nCacheY -nNewCacheY); the Y subscript of the upper end of the intersection area of the new and old caches = min(nCacheLength-1, nCacheLength-1 +nCacheY - nNewCacheY), which is the maximum value of the two. No intersection: If the endpoint subscripts are left > right or bottom > top (such as no intersection in the horizontal direction), the data of the entire cache block is cleared.
[0106] In the case of intersection: copy the old data in the intersecting area to the corresponding position of the new cache block.
[0107] The following is the relevant program code for processing the intersection area and non-intersection area in this embodiment: Update Cache Center: Updates the cache chunk position (nCacheX, nCacheY) to the render chunk position, which is also the current position of the player's character (nRenderX, nRenderY). Step 810: Data submission for rendering: Each frame checks the number of frames since the last submission. If it does not exceed the set threshold, the submission is skipped. The rendering rectangle is traversed row by row (X direction), and only the rows with changed data are submitted. When submitting, a continuous row of snow data is sent to the graphics engine.
[0108] In the above embodiment, when expanding the map and increasing the accuracy, the processor performance and memory consumption are fixed by fixing the cache rectangle size, so that the processor and memory consumption will not be affected by changes in the map or accuracy. The cache rectangle and the rendering rectangle are set, and the algorithm for checking the cache rectangle to update the position and the cache rectangle update algorithm are used. The cache rectangle update algorithm first determines the non-intersection situation. In the case of intersection, the data of the corresponding row is accurately copied, ensuring that the picture around the player can be accurately rendered, and the interaction information between the player and the snow can be retained when the player moves in a small range, solving the problem of data discontinuity or disappearance.
[0109] Corresponding to the above method embodiment, the present application also provides an embodiment of an object rendering device. Figure 9 FIG. 1 shows a schematic diagram of a structure of a motion control device for a humanoid object in a virtual scene provided by an embodiment of the present application. Figure 9As shown, the device includes: Acquisition module 901: configured to acquire the role position of the target role; Determining module 902: configured to determine a rendering block according to the position of the character, wherein the rendering block is used to record object data of a target object to be rendered in a target scene, the object data recorded by the rendering block is determined based on object data cached by a cache block and character information of the target character, the cache block is used to cache the object data of the target object in the target scene, and the cache block includes the rendering block; Rendering module 903: configured to render the target object to be rendered according to the object data recorded by the rendering block.
[0110] Furthermore, the determination module 902 is specifically configured to determine the rendering block position corresponding to the rendering block in the target scene according to the character position, and obtain the current cache block position corresponding to the cache block in the target scene; when the cache block cache update is triggered according to the rendering block position and the current cache block position, determine the updated cache block position corresponding to the cache block based on the rendering block position; update the object data of the target object cached in the cache block according to the updated cache block position; and determine the object data of the target object to be rendered recorded by the rendering block based on the object data cached in the updated cache block and the character information of the target character.
[0111] Furthermore, the determination module 902 is specifically configured to identify the current relative position of the rendering block and the cache block according to the rendering block position and the current cache block position; and trigger the cache update of the cache block when the current relative position meets the preset movement condition.
[0112] Furthermore, the determination module 902 is specifically configured to identify whether there is a displacement intersection corresponding to the cache block based on the current cache block position and the updated cache block position; if there is a displacement intersection, based on the current cache block position, copy the object data of the intersection area in the cache block to a temporary array, and clear the object data cached in the cache block; based on the updated cache block position, cache the object data in the temporary array in sequence to the intersection area of the cache block, and write the object data in the target scene into the remaining cache area of the cache block.
[0113] Furthermore, the determination module 902 is specifically configured to clear the object data cached in the cache block when there is no displacement intersection; and write the object data in the target scene into the cache block based on the updated cache block position.
[0114] Furthermore, the determination module 902 is specifically configured to determine the initial endpoint information and the update endpoint information of the cache block based on the current cache block position and the updated cache block position; determine the change distance corresponding to the cache block based on the initial endpoint information and the update endpoint information; and based on the change distance, identify whether there is a displacement intersection corresponding to the cache block.
[0115] Furthermore, the above-mentioned object rendering device further includes: A coordinate system determination module is configured to determine a global coordinate system corresponding to the target scene and a cache coordinate system corresponding to the cache block; A construction module is configured to construct a conversion relationship between the global coordinate system and the cache coordinate system, wherein the conversion relationship is used to convert the character position of the target character, the rendering block position corresponding to the rendering block, and the cache block position corresponding to the cache block to the same coordinate system.
[0116] The above is a schematic scheme of an object rendering device of this embodiment. It should be noted that the technical solution of the object rendering device and the technical solution of the object rendering method mentioned above belong to the same concept. For details not described in detail in the technical solution of the object rendering device, please refer to the description of the technical solution of the object rendering method mentioned above. In addition, the various components in the device embodiment should be understood as functional modules that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.
[0117] Figure 10 10. The structure of a computing device 1000 according to an embodiment of the present application is shown. The components of the computing device 1000 include, but are not limited to, a memory 1010 and a processor 1020. The processor 1020 is connected to the memory 1010 via a bus 1030, and a database 1050 is used to store data.
[0118] The computing device 1000 also includes an access device 1040 that enables the computing device 1000 to communicate via one or more networks 1060. Examples of such networks include a PSTN (Public Switched Telephone Network), a LAN (Local Area Network), a WAN (Wide Area Network), a PAN (Personal Area Network), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a NIC (Network Interface Controller)) whether wired or wireless, such as an IEEE 802.11 WLAN (Wireless Local Area Network) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a USB (Universal Serial Bus) interface, a cellular network interface, a Bluetooth interface, or NFC (Near Field Communication).
[0119] In one embodiment of the present application, the above components of the computing device 1000 and Figure 10 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 10 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0120] Computing device 1000 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a PC (Personal Computer). Computing device 1000 may also be a mobile or stationary server.
[0121] The processor 1020 is configured to execute computer executable instructions of the object rendering method.
[0122] The above is a schematic solution of a computing device of this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the object rendering method described above are based on the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the object rendering method described above.
[0123] An embodiment of the present application further provides a computer-readable storage medium storing a computer program / instruction. When the computer program / instruction is executed by a processor, the computer program / instruction is used for an object rendering method.
[0124] The above is a schematic diagram of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the object rendering method described above are based on the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the object rendering method described above.
[0125] An embodiment of the present application further provides a computer program product, including a computer program / instruction, which is used in an object rendering method when executed by a processor.
[0126] The above is a schematic diagram of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the object rendering method described above are based on the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the object rendering method described above.
[0127] The computer program / instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard drive, magnetic disk, optical disk, computer memory, ROM (Read-Only Memory), RAM (Random Access Memory), electric carrier signals, telecommunication signals, and software distribution media. It should be noted that the content of the computer-readable medium may be appropriately increased or decreased based on the requirements of legislation and patent practice within a jurisdiction. For example, in some jurisdictions, based on legislation and patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.
[0128] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0129] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0130] The preferred embodiments of the present application disclosed above are intended only to help illustrate the present application. The optional embodiments do not describe all details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of this application. This application selects and describes these embodiments in detail in order to better explain the principles and practical applications of this application, so that those skilled in the art can better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.
Claims
1. A method for rendering an object, characterized in that: include: Get the target character's position; Determining a rendering block according to the position of the character, wherein the rendering block is used to record object data of a target object to be rendered in a target scene, the object data recorded by the rendering block is determined based on object data cached by a cache block and character information of the target character, the cache block is used to cache the object data of the target object in the target scene, and the cache block includes the rendering block; Rendering the target object to be rendered according to the object data recorded by the rendering block.
2. The method according to claim 1, characterized in that The determining of the rendering block according to the position of the character includes: Determine, based on the character position, a rendering block position corresponding to a rendering block in a target scene, and obtain a current cache block position corresponding to a cache block in the target scene; In a case where the cache block cache update is triggered according to the rendering block position and the current cache block position, determining an updated cache block position corresponding to the cache block based on the rendering block position; updating the object data of the target object cached in the cache block according to the updated cache block position; Based on the updated object data cached in the cache block and the role information of the target role, the object data of the target object to be rendered recorded by the rendering block is determined.
3. The method according to claim 2, characterized in that The triggering of the cache block cache update according to the rendering block position and the current cache block position includes: Identifying a current relative position between the rendering block and the cache block according to the rendering block position and the current cache block position; When the current relative position meets a preset movement condition, the cache block cache update is triggered.
4. The method according to claim 2, characterized in that The updating of the object data of the target object cached in the cache block according to the updated cache block position includes: Identifying, based on the current cache block position and the updated cache block position, whether there is an intersection between displacements corresponding to the cache blocks; In the case of displacement intersection, based on the current cache block position, copy the object data of the intersecting area in the cache block to a temporary array, and clear the object data cached in the cache block; Based on the updated cache block position, the object data in the temporary array is sequentially cached to the intersection area of the cache block, and the object data in the target scene is correspondingly written to the remaining cache area of the cache block.
5. The method according to claim 4, characterized in that After identifying whether there is an intersection of displacements corresponding to the cache blocks, the method further includes: In the absence of displacement intersection, clearing the object data cached in the cache block; Based on the updated cache block position, the object data in the target scene is written into the cache block accordingly.
6. The method according to claim 4, characterized in that The step of identifying, based on the current cache block position and the updated cache block position, whether there is an intersection of displacements corresponding to the cache blocks includes: Determining initial endpoint information and update endpoint information of the cache block according to the current cache block position and the update cache block position; Determining a change distance corresponding to the cache block according to the initial endpoint information and the update endpoint information; Based on the change distance, it is identified whether there is an intersection of displacements corresponding to the cache blocks.
7. The method according to any one of claims 1 to 6, characterized in that Before obtaining the role position of the target role, the method further includes: Determine a global coordinate system corresponding to the target scene and a cache coordinate system corresponding to the cache block; A conversion relationship between the global coordinate system and the cache coordinate system is constructed, wherein the conversion relationship is used to convert the character position of the target character, the rendering block position corresponding to the rendering block, and the cache block position corresponding to the cache block to the same coordinate system.
8. An object rendering device, characterized in that: include: An acquisition module, configured to acquire a role position of a target role; a determination module configured to determine a rendering block according to the position of the character, wherein the rendering block is used to record object data of a target object to be rendered in a target scene, the object data recorded by the rendering block is determined based on object data cached by a cache block and character information of the target character, the cache block is used to cache the object data of the target object in the target scene, and the cache block includes the rendering block; The rendering module is configured to render the target object to be rendered according to the object data recorded by the rendering block.
9. A computing device, characterized in that include: memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program / instruction, and when the computer program / instruction is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
11. A computer program product, characterized in that The method comprises a computer program / instruction, which implements the method according to any one of claims 1 to 7 when executed by a processor.