Object rendering method, information processing method, device, equipment and storage medium

CN122966802APending Publication Date: 2026-10-23SAROS NETWORK TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510477761.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0004]然而,虚拟场景中往往具有繁多的对象,上述材质信息的配置方法具有较高的数据冗余度

Benefits of technology

[0073]将第一对象的颜色信息编码在用于指示第一对象在虚拟场景中的位置的世界坐标中,因此,在渲染第一对象之前,可以直接从第一对象的世界坐标中解码得到第一对象的颜色信息。采用上述方法,无需在第一对象的材质信息中再单独配置第一对象的颜色信息,从而减少了渲染第一对象所使用的材质信息的数据冗余度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122966802A_ABST
    Figure CN122966802A_ABST
Patent Text Reader

Abstract

The application discloses an object rendering method, an information processing method, an apparatus, an equipment and a storage medium, and relates to the technical field of computer graphics. The method comprises the following steps: acquiring the world coordinates of a first object in a virtual scene; decoding the world coordinates of the first object to obtain color information of the first object; and rendering the first object based on the color information of the first object. By using the method, the color information of the first object does not need to be separately configured in the material information of the first object, thereby reducing the data redundancy of the material information used for rendering the first object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer graphics technology, and in particular to an object rendering method, information processing method, apparatus, device and storage medium. Background Technology

[0002] When displaying an object in a virtual scene on the terminal, it is necessary to first obtain the object's color, texture, and other material information in order to perform rendering on the object.

[0003] The aforementioned color, texture, and other information are usually different data in the data file of the virtual scene. For example, for a tree in the virtual scene, the data file of the virtual scene will pre-configure the color information, texture map, etc. of the tree as the material information used when rendering the tree.

[0004] However, virtual scenes often contain a large number of objects, and the above-mentioned method of configuring material information has a high degree of data redundancy. Summary of the Invention

[0005] This application provides an object rendering method, an information processing method, an apparatus, a device, and a storage medium. The technical solutions provided by this application include the following aspects.

[0006] According to one aspect of the embodiments of this application, an object rendering method is provided, the method comprising:

[0007] Obtain the world coordinates of a first object in the virtual scene. The world coordinates of the first object are used to indicate the position of the first object in the virtual scene, and the world coordinates of the first object carry the color information of the first object.

[0008] Decode the world coordinates of the first object to obtain the color information of the first object;

[0009] The first object is rendered based on its color information.

[0010] In one possible implementation, decoding the world coordinates of the first object to obtain the color information of the first object includes:

[0011] The color information of the first object is obtained based on at least one of the mantissa bits of the representation to be processed, wherein the representation to be processed is a floating-point representation of the world coordinates of the first object.

[0012] In one possible implementation, the world coordinates of the first object include M coordinate values, and the representation to be processed includes the floating-point representation of each of the M coordinate values, where M is an integer greater than 1;

[0013] The color information of the first object includes the color values ​​corresponding to the first object in each of the M color channels;

[0014] The floating-point representations of the different coordinate values ​​among the M coordinate values ​​are used to carry the color values ​​corresponding to different color channels of the first object in the M color channels.

[0015] In one possible implementation, the M coordinate values ​​include a first coordinate value, and the M color channels include a first color channel;

[0016] Obtaining the color information of the first object based on at least one bit of the mantissa of the representation to be processed includes:

[0017] The value indicated by the last N bits of the floating-point representation of the first coordinate value is determined as the first value, where N is a positive integer. All bits of the floating-point representation of the first coordinate value are used to determine the position of the first object in the first direction in the virtual scene.

[0018] Based on the first value, the color value of the first object in the first color channel is obtained.

[0019] In one possible implementation, N is a positive integer less than or equal to 8.

[0020] In one possible implementation, the value of N is negatively correlated with the size of the virtual scene in the first direction.

[0021] In one possible implementation, the world coordinates of the first object include P coordinate values, and the representation to be processed includes the floating-point representation of each of the P coordinate values, where P is an integer greater than 1;

[0022] The color information of the first object includes the color values ​​of the first object in Q color channels, where Q is a positive integer;

[0023] Wherein, the floating-point representation of one of the P coordinate values ​​is used to carry the color value corresponding to at least two color channels of the first object in the Q color channels; or, the color value corresponding to one color channel of the first object in the Q color channels is carried by the floating-point representation of each of the at least two coordinate values ​​in the P coordinate values.

[0024] In one possible implementation, the method further includes:

[0025] The world coordinates of the first object are converted from decimal to binary floating-point numbers to obtain the representation to be processed.

[0026] In one possible implementation, rendering the first object based on its color information includes:

[0027] Based on the color information of at least two objects, render the at least two objects in batches;

[0028] The at least two objects include the first object, the at least two objects have the same geometric structure, and at least one of the at least two objects has different color information from the first object.

[0029] According to one aspect of the embodiments of this application, an information processing method is provided, the method comprising:

[0030] Obtain the world coordinates and color information of the first object in the virtual scene. The world coordinates of the first object are used to indicate the position of the first object in the virtual scene, and the color information of the first object is used to indicate the color used to render the first object.

[0031] Based on the color information of the first object, the world coordinates of the first object are encoded to obtain the encoded world coordinates of the first object, and the encoded world coordinates of the first object carry the color information of the first object.

[0032] Replace the world coordinates of the first object with the encoded world coordinates.

[0033] In one possible implementation, encoding the world coordinates of the first object based on its color information includes:

[0034] Based on the color information of the first object, at least one bit of the mantissa of the representation to be processed is changed to obtain the encoded representation to be processed, wherein the representation to be processed is a floating-point representation of the world coordinates of the first object;

[0035] Based on the encoded representation to be processed, the encoded world coordinates of the first object are obtained.

[0036] In one possible implementation, the world coordinates of the first object include M coordinate values, and the representation to be processed includes the floating-point representation of each of the M coordinate values, where M is an integer greater than 1;

[0037] The color information of the first object includes the color values ​​corresponding to the first object in each of the M color channels;

[0038] The floating-point representations of the different coordinate values ​​among the M coordinate values ​​are used to carry the color values ​​corresponding to different color channels of the first object in the M color channels.

[0039] In one possible implementation, the M coordinate values ​​include a first coordinate value, and the M color channels include a first color channel;

[0040] The step of changing at least one bit of the mantissa of the representation to be processed based on the color information of the first object to obtain the encoded representation to be processed includes:

[0041] The last N bits of the floating-point representation of the first coordinate value are replaced with the first numerical value to obtain the encoded floating-point representation of the first coordinate value. The first numerical value has a mapping relationship with the color value corresponding to the first object in the first color channel.

[0042] In one possible implementation, the world coordinates of the first object include P coordinate values, and the representation to be processed includes the floating-point representation of each of the P coordinate values, where P is an integer greater than 1;

[0043] The color information of the first object includes the color values ​​of the first object in Q color channels, where Q is an integer greater than 1;

[0044] Wherein, the floating-point representation of one of the P coordinate values ​​is used to carry the color value corresponding to at least two color channels of the first object in the Q color channels; or, the color value corresponding to one color channel of the first object in the Q color channels is carried by the floating-point representation of each of the at least two coordinate values ​​in the P coordinate values.

[0045] In one possible implementation, the method further includes:

[0046] Convert the world coordinates of the first object from decimal to binary floating-point numbers to obtain the representation to be processed;

[0047] The process of obtaining the encoded world coordinates of the first object based on the encoded representation to be processed includes:

[0048] The encoded representation to be processed is converted from binary floating-point number to decimal to obtain the encoded world coordinates of the first object.

[0049] In one possible implementation, obtaining the world coordinates of the first object in the virtual scene and the color information of the first object includes:

[0050] Display the virtual scene's display screen. When the brush range in the display screen covers the first object, obtain the world coordinates of the first object and the color information of the first object. The brush range is used to set the color of objects in the virtual scene in a regional manner.

[0051] or,

[0052] Display the virtual scene's display screen, and in response to an operation on the first object in the display screen, display the parameter setting interface of the first object, and in response to an operation on the parameter setting interface, obtain the world coordinates and color information of the first object.

[0053] In one possible implementation, the method further includes:

[0054] In response to moving a second object in the virtual scene from a first position to a second position, first world coordinates and color information of the second object are obtained, wherein the first world coordinates are used to indicate the second position and the color information of the second object is used to indicate the color used to render the second object;

[0055] Based on the color information of the second object, the first world coordinates are encoded to obtain the encoded first world coordinates;

[0056] The world coordinates of the second object are replaced with the encoded first world coordinates, which are used to indicate the position of the second object in the virtual scene.

[0057] In one possible implementation, the method further includes:

[0058] In response to adding a third object to a third position in the virtual scene, second world coordinates and preset color information are obtained, wherein the second world coordinates are used to indicate the third position and the preset color information is used to indicate the color used to render the newly added object in the virtual scene;

[0059] Based on the preset color information, the second world coordinates are encoded to obtain the encoded second world coordinates;

[0060] The world coordinates of the third object are replaced with the encoded second world coordinates, which are used to indicate the position of the third object in the virtual scene.

[0061] According to one aspect of the embodiments of this application, an object rendering apparatus is provided, the apparatus comprising:

[0062] The acquisition module is used to acquire the world coordinates of a first object in a virtual scene. The world coordinates of the first object are used to indicate the position of the first object in the virtual scene, and the world coordinates of the first object carry the color information of the first object.

[0063] The decoding module is used to decode the world coordinates of the first object to obtain the color information of the first object;

[0064] The rendering module is used to render the first object based on the color information of the first object.

[0065] According to one aspect of the embodiments of this application, an information processing apparatus is provided, the apparatus comprising:

[0066] The acquisition module is used to acquire the world coordinates and color information of a first object in a virtual scene. The world coordinates of the first object are used to indicate the position of the first object in the virtual scene, and the color information of the first object is used to indicate the color used to render the first object.

[0067] An encoding module is used to encode the world coordinates of the first object based on the color information of the first object, so as to obtain the encoded world coordinates of the first object, wherein the encoded world coordinates of the first object carry the color information of the first object.

[0068] The replacement module is used to replace the world coordinates of the first object with the encoded world coordinates of the first object.

[0069] According to one aspect of the embodiments of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-described object rendering method, or to implement the above-described information processing method.

[0070] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, the computer program being loaded and executed by a processor to implement the above-described object rendering method or the above-described information processing method.

[0071] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program stored in a computer-readable storage medium, and a processor reading from the computer-readable storage medium and executing the computer program to implement the above-described object rendering method or the above-described information processing method.

[0072] The technical solution provided in this application can bring the following beneficial effects:

[0073] The color information of the first object is encoded in world coordinates, which indicate the position of the first object in the virtual scene. Therefore, before rendering the first object, its color information can be directly decoded from its world coordinates. Using this method, there is no need to separately configure the color information of the first object in its material information, thus reducing data redundancy in the material information used for rendering the first object. Attached Figure Description

[0074] Figure 1 This is a schematic diagram of tree objects with the same material information in a virtual scene provided in one embodiment of this application;

[0075] Figure 2 This is a schematic diagram of a computer system provided in one embodiment of this application;

[0076] Figure 3 This is a flowchart of an object rendering method provided in one embodiment of this application;

[0077] Figure 4 This is a flowchart of an object rendering method provided in another embodiment of this application;

[0078] Figure 5 This is a schematic diagram of the coordinate value decoding process provided in one embodiment of this application;

[0079] Figure 6 This is a schematic diagram of a single-precision floating-point number provided in one embodiment of this application;

[0080] Figure 7 This is a flowchart of an information processing method provided in one embodiment of this application;

[0081] Figure 8 This is a schematic diagram of the editing interface of a virtual scene provided in one embodiment of this application;

[0082] Figure 9 This is a schematic diagram of virtual scene partitioning provided in one embodiment of this application;

[0083] Figure 10 This is a schematic diagram of the parameter setting interface of the first object provided in one embodiment of this application;

[0084] Figure 11 This is a schematic diagram of a color preset list provided in one embodiment of this application;

[0085] Figure 12 This is a flowchart of an information processing method provided in another embodiment of this application;

[0086] Figure 13 This is a schematic diagram of the coordinate value encoding process provided in one embodiment of this application;

[0087] Figure 14 This is a flowchart of an information processing method provided in another embodiment of this application;

[0088] Figure 15 This is a flowchart of an information processing method provided in another embodiment of this application;

[0089] Figure 16 This is a block diagram of an object rendering apparatus provided in one embodiment of this application;

[0090] Figure 17 This is a block diagram of an information processing apparatus provided in one embodiment of this application;

[0091] Figure 18 This is a structural block diagram of a computer device provided in one embodiment of this application. Detailed Implementation

[0092] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0093] Before introducing the technical solution of this application, some terms involved in this application will be explained. The following related explanations are optional and can be combined with the technical solutions of the embodiments of this application in any way, all of which fall within the protection scope of this application. The embodiments of this application include at least some of the following contents.

[0094] Virtual Scene: A virtual scene is a scene displayed (or provided) by an application while it is running on a computer device. A virtual scene can be a simulation of the real world, a semi-simulated / semi-fictional scene, or a purely fictional scene. A virtual scene can be any of the following: two-dimensional virtual scene, 2.5-dimensional virtual scene, or three-dimensional virtual scene; this application does not limit this.

[0095] Scene Editor: An editor program for configuring virtual scenes.

[0096] Material information: A set of properties that describe how the surface of a virtual object reflects light.

[0097] Shader: A small program that runs in the graphics processor within a graphics card and is used to perform calculations on various graphics units in parallel.

[0098] Batch merging: Batch merging is an optimization technique that combines multiple smaller rendering batches into a larger rendering batch for processing, in order to improve rendering efficiency. Batch merging can only be used for multiple virtual objects if their material information is the same.

[0099] Encoding and decoding: Encoding is the process of converting information from one form to another, with the aim of facilitating the storage, transmission and processing of information; decoding, on the contrary, is the process of restoring encoded information to the original information.

[0100] RGB color mode: a color standard that refers to obtaining various colors by varying the three color channels R (Red), G (Green), and B (Blue) and superimposing them. The R, G, and B values ​​represent the color values ​​of the red, green, and blue channels, and the magnitude of the color value reflects the brightness of the color channel.

[0101] World coordinates: World coordinates are based on a global, fixed coordinate system that uses a fixed point in the virtual scene as the origin to indicate the position of virtual objects in the virtual scene.

[0102] Binary: Binary is a number system based on 2, usually represented by 0 and 1, and is widely used in computers.

[0103] Floating-point numbers: Floating-point numbers are a numerical encoding format used to represent real numbers. They expand the range of numerical representation by dynamically adjusting the position of the decimal point while maintaining precision.

[0104] Single-precision floating-point numbers: Single-precision floating-point numbers typically use 32 bits (4 bytes) to store a real number, and the range and precision of the values ​​they can represent are limited.

[0105] Floating-point precision error: Computers store floating-point numbers in binary, but many decimal fractions cannot be accurately represented by a finite number of binary bits, which leads to floating-point precision errors. For example, the binary representation of 0.1 is an infinite repeating decimal 0.0001100110011…, but computers can only truncate a certain number of bits when storing it, resulting in precision errors.

[0106] In related technologies, technicians can pre-configure some object assets. Each object asset can be understood as a virtual object with pre-configured material information. This object asset can be repeatedly added to the virtual scene, meaning multiple objects in the virtual scene can correspond to one object asset. In these technologies, the color information of the virtual object is configured in the material information of the object asset to indicate the color used when rendering the virtual object. On the one hand, to enrich the colors in the virtual scene, artists need to create a large number of object assets, which greatly increases the difficulty of asset management and maintenance costs, requiring more artistic manpower. On the other hand, if an artist finds that the color of an object does not meet their expectations while editing the scene, they need to first browse the object's asset catalog to search for an object asset that meets their color requirements. If found, they select the object asset and place an instance of it in the scene; if not, they need to copy the object asset, modify its material information for color, and then place it in the scene. In other words, the above approach leads to artists spending a lot of time checking, creating, and modifying assets while editing the virtual scene, rather than quickly achieving the desired color effects within the scene. Finally, during rendering, there will be multiple asset objects of different colors in the scene. Even if these asset objects differ only in color, they cannot be batched during rendering because of the different color information in the material information, resulting in additional consumption of rendering performance.

[0107] The technical solution provided in this application embodiment directly encodes the color information of virtual objects into the world coordinates of virtual objects, taking into account both artistic effect and performance, while simplifying the production and management of the aforementioned object assets.

[0108] For example, please refer to Figure 1 The virtual scene 10 includes a first tree object 11 and a second tree object 12. The first tree object 11 and the second tree object 12 have the same geometry and texture, differing only in color information. In this embodiment, the color information of the first tree object 11 and the second tree object 12 is encoded into their respective world coordinates. Therefore, they can reuse the same material information, and the first tree object 11 and the second tree object 12 belong to the same asset object. Furthermore, when rendering the first tree object 11 and the second tree object 12, the corresponding color information can be directly decoded from their world coordinates and then combined with the same material information (which does not include color information) for batch rendering.

[0109] Please refer to Figure 2 The diagram illustrates a computer system provided in one embodiment of this application. The computer system includes an editing device 20 and a terminal device 30.

[0110] The editing device 20 is used to edit virtual scenes. In some embodiments, the editing device 20 has a first application (such as a scene editor) installed for editing virtual scenes. In some embodiments, the editing device 20 is used to edit virtual scenes in a second application, which is an application that supports displaying virtual scenes, such as a game application, a social application, etc. The aforementioned game applications include, but are not limited to: multiplayer online battle arena (MOBA) games, open-world games, first-person shooter (FPS) games, third-person shooter (TPS) games, adventure games (ATG), action games (ACT), and simulation games (SLG), etc. In some embodiments, after the editing device 20 completes the editing of the virtual scene, it exports a data file of the virtual scene. This data file includes data such as world coordinates, structural information, and material information of various objects in the virtual scene. This data file can be packaged in related files of the second application (such as the installation package, update patch, configuration file, etc. of the second application).

[0111] The terminal device 30 may have the aforementioned second application installed. In some embodiments, when the second application is running, the terminal device 30 obtains the world coordinates and material information of the first object in the virtual scene from the data file of the virtual scene, decodes the color information of the first object from the world coordinates of the first object, and then performs rendering on the first object. The terminal device 30 finally displays the virtual scene including the rendered first object.

[0112] In the embodiments of this application, the data file exported by the editing device 20 can be directly sent to the terminal device 30, or it can be provided to the terminal device 30 through other devices or platforms (such as application distribution platforms). This application does not limit this.

[0113] Furthermore, in this embodiment, the implementation form of the first application and the second application is not limited. For example, they can be applications that need to be downloaded and installed, mini-programs that do not require installation, web applications, etc.

[0114] Please refer to Figure 3 The diagram illustrates a flowchart of an object rendering method provided in one embodiment of this application. The execution entity for each step of this method can be a computer device, which can be the editing device 20 described in the above embodiment or a terminal device 30. The method may include at least one of the following steps (310-330).

[0115] Step 310: Obtain the world coordinates of the first object in the virtual scene.

[0116] The world coordinates of the first object are used to indicate the position of the first object in the virtual scene, and the world coordinates of the first object carry the color information of the first object.

[0117] The first object is any type of object in the virtual scene, such as buildings, trees, rocks, etc.

[0118] The world coordinates of the first object include at least two coordinate values.

[0119] In some embodiments, when the virtual scene is a two-dimensional virtual scene, the world coordinates of the first object include a first coordinate value and a second coordinate value. The first coordinate value indicates the position of the first object in a first direction within the virtual scene, and the second coordinate value indicates the position of the first object in a second direction within the virtual scene. In this embodiment, the first direction and the second direction are the directions of two axes of a two-dimensional coordinate system configured for the two-dimensional virtual scene.

[0120] In some embodiments, when the virtual scene is a three-dimensional virtual scene, the world coordinates of the first object include a first coordinate value, a second coordinate value, and a third coordinate value. The first coordinate value indicates the position of the first object in a first direction within the virtual scene, the second coordinate value indicates the position of the first object in a second direction within the virtual scene, and the third coordinate value indicates the position of the first object in a third direction within the virtual scene. In this embodiment, the first direction, the second direction, and the third direction are the directions of the three axes of a three-dimensional coordinate system configured for the virtual scene.

[0121] In some embodiments, the color information of the first object is carried in a portion of the bits of the floating-point representation of the world coordinates of the first object.

[0122] Step 320: Decode the world coordinates of the first object to obtain the color information of the first object.

[0123] The color information of the first object is used to indicate the color used to render the first object.

[0124] In some embodiments, the color information of the first object includes the color values ​​of the first object corresponding to at least one color channel.

[0125] For example, if the color information of the first object only includes the color value corresponding to the first object in one color channel, the color value is used to indicate the grayscale of the first object.

[0126] For example, if the color information of the first object includes the color values ​​corresponding to the first object in three color channels, these three color channels can be the R, G, and B color channels introduced above.

[0127] In some embodiments, the color information of the first object is carried in at least one bit of the mantissa of the floating-point representation of the world coordinates of the first object.

[0128] In some embodiments, please refer to Figure 4 Step 320 includes step 322.

[0129] Step 322: Based on at least one bit of the mantissa of the representation to be processed, obtain the color information of the first object. The representation to be processed is a floating-point representation of the world coordinates of the first object.

[0130] The floating-point number representation mentioned in the embodiments of this application can be a single-precision floating-point number or a double-precision floating-point number, and this application does not limit it.

[0131] In some embodiments, the world coordinates of the first object include at least two coordinate values. The representation to be processed includes floating-point representations of each of the at least two coordinate values.

[0132] In the above embodiment, the color information of the first object is encoded into the mantissa of the floating-point representation of the world coordinates of the first object. This utilizes the storage principle of binary floating-point numbers in computers to minimize the impact of encoding the color information of the first object on the position of the first object indicated by the world coordinates of the first object. This will be explained in more detail in the following embodiments.

[0133] In some embodiments, prior to step 322, the world coordinates of the first object are converted from decimal to binary floating-point numbers to obtain the representation to be processed.

[0134] In some embodiments, the at least two coordinate values ​​are converted from decimal to binary floating-point numbers to obtain the floating-point representations of the at least two coordinate values ​​respectively.

[0135] For example, please refer to Figure 5 The first coordinate value is converted from decimal to binary floating-point number to obtain the floating-point representation of the first coordinate value.

[0136] In some scenarios, computer devices cannot directly perform bitwise operations on the decimal value of the world coordinates of the first object. Through the above conversion steps, a floating-point representation that supports bitwise operations can be obtained, which can ensure the smooth progress of the decoding process.

[0137] Step 330: Render the first object based on its color information.

[0138] The rendering steps for the first object can be implemented using the shaders described above.

[0139] In some embodiments, the first object is rendered based on its color information, material information, and lighting information. The material information of the first object includes any attribute information other than the color information of the first object that affects the surface of the first object's reflection of light, such as the texture map of the first object. The lighting information of the first object is used to describe the lighting conditions of the first object.

[0140] In some embodiments, step 330 includes: batch rendering at least two objects based on their respective color information. The at least two objects include a first object, the at least two objects have the same geometric structure, and at least one of the at least two objects has different color information from the first object.

[0141] Similar to the color information of the first object, the color information of at least two objects other than the first object can be decoded from the world coordinates of the other objects, which will not be elaborated further in this application.

[0142] In some embodiments, at least two objects are batch rendered based on first material information, color information of at least two objects, and lighting information of at least two objects. The first material information is material information shared by at least two objects, such as a shared texture map.

[0143] In the above embodiment, since the color information of at least two objects is decoded from their respective world coordinates, batch rendering can be achieved even if the colors of at least two objects are different, as long as their geometric shapes and material information are the same, thereby improving rendering performance.

[0144] The technical solution provided in this application encodes the color information of the first object in world coordinates, which indicate the position of the first object in the virtual scene. Therefore, before rendering the first object, the color information of the first object can be directly decoded from its world coordinates. Using this method, it is unnecessary to separately configure the color information of the first object in its material information, thereby reducing the data redundancy of the material information used for rendering the first object.

[0145] Furthermore, the above solution can reduce the problem of material variants in the data files of virtual scenes (material variants refer to the problem of generating a series of different versions of material information by modifying or adjusting some of its properties based on a certain basic material information), which also helps to optimize rendering performance.

[0146] In some embodiments, the world coordinates of the first object include M coordinate values, and the representation to be processed includes the floating-point representation of each of the M coordinate values, where M is an integer greater than 1.

[0147] The color information of the first object includes the color values ​​corresponding to the first object in each of the M color channels.

[0148] The floating-point representation of the different coordinate values ​​among the M coordinate values ​​is used to carry the color values ​​corresponding to the different color channels of the first object in the M color channels.

[0149] For example, M = 3, and the world coordinates of the first object include the first coordinate value, the second coordinate value, and the third coordinate value described above. The M color channels include a first color channel (e.g., R channel), a second color channel (e.g., G channel), and a third color channel (e.g., B channel). The floating-point representation of the first coordinate value is used to carry the color value of the first object in the first color channel, the floating-point representation of the second coordinate value is used to carry the color value of the first object in the second color channel, and the floating-point representation of the third coordinate value is used to carry the color value of the first object in the third color channel.

[0150] In the above embodiment, the M coordinate values ​​correspond one-to-one with the color values ​​of the first object in the M color channels (for example, in a 3D virtual scene, the three coordinate values ​​of the world coordinates correspond one-to-one with the three color channels RGB). That is to say, by decoding a coordinate value, the color value of the first object in one color channel can be obtained. By decoding M coordinate values, the color values ​​of the first object in the M color channels can be obtained one-to-one. This decoding method has low implementation complexity.

[0151] In some embodiments, the M coordinate values ​​include the aforementioned first coordinate values, and the M color channels include the aforementioned first color channels. Step 322 includes the following sub-steps:

[0152] 1. The value indicated by the last N bits of the floating-point representation of the first coordinate value is determined as the first value, where N is a positive integer. All bits of the floating-point representation of the first coordinate value are used to determine the position of the first object in the first direction in the virtual scene.

[0153] For example, the floating-point representation of the first coordinate value is as follows: Figure 6 The 32-bit single-precision floating-point number shown includes 1 sign bit, 8 exponent bits, and 23 mantissa bits. All 32 bits of this floating-point number are used to determine the position of the first object in the virtual scene in a first direction. The value indicated by the last 5 bits of these 23 mantissa bits is determined as a first numerical value that has a mapping relationship with the color value corresponding to the first object in the first color channel.

[0154] 2. Based on the first value, obtain the color value of the first object corresponding to the first color channel.

[0155] In some embodiments, the first value is directly determined as the color value corresponding to the first color channel.

[0156] In some embodiments, the color value of each color channel includes 256 values, such as 0, 1 / 256, 2 / 256, ..., 255 / 256, etc. Figure 5 As shown, divide the first value by 2 N This allows us to obtain the color value of the first object corresponding to the first color channel (such as a color value in the RGB channel). For example, N = 5, the last N bits of the floating-point representation of the first coordinate value are 00110, the first value is 6, and 2... 5 =32, then the color value of the first object in the first color channel is 6 / 32 = 48 / 256 (that is, the 49th color value in the first color channel sorted from low to high brightness).

[0157] In the above embodiment, only the last N bits of the mantissa of the floating-point representation of the first coordinate value are used to indicate the first value. That is to say, this application actually uses the N bits that have the least impact on the value indicated by the floating-point representation to carry the corresponding color value. Therefore, the above method can make the influence of the N bits used to determine the color value on the position as small as possible when all bits of the floating-point representation of the first coordinate value are used to determine the corresponding position (even if these N bits are changed, there will be no perceptible shift to the position).

[0158] It should be noted that the method for determining the color value of the first object in color channels other than the first color channel based on the coordinate values ​​other than the first coordinate value among the M coordinate values ​​can refer to the two sub-steps in step 322 above, and will not be explained in detail hereafter.

[0159] In some embodiments, the M coordinate values ​​further include second coordinate values, and the M color channels further include the aforementioned second color channels. Step 322 further includes the following sub-steps:

[0160] 3. The value indicated by the last R bits of the floating-point representation of the second coordinate value is determined as the second value, where R is a positive integer. All bits of the floating-point representation of the second coordinate value are used to determine the position of the first object in the second direction in the virtual scene.

[0161] 4. Based on the second value, obtain the color value of the first object in the second color channel.

[0162] In some embodiments, the M coordinate values ​​further include a third coordinate value, and the M color channels further include the aforementioned third color channel. Step 322 further includes the following sub-steps:

[0163] 5. The value indicated by the last T bits of the floating-point representation of the third coordinate value is determined as the third numerical value, where T is a positive integer. All bits of the floating-point representation of the third coordinate value are used to determine the position of the first object in the virtual scene in the third direction. The values ​​of N, R, and T mentioned above can be the same or different, and this application does not limit this.

[0164] 6. Based on the third value, obtain the color value of the first object in the third color channel.

[0165] In some embodiments, N is a positive integer less than or equal to 8.

[0166] When N equals 8, the last N bits of the floating-point representation of the first coordinate value can indicate a total of 2 values. 8 =256, which corresponds exactly to the 256 color values ​​in each color channel, thus enabling this scheme to carry any color value in the color channel in the floating-point representation of the first coordinate value.

[0167] When N is less than 8, fewer bits are used to carry the corresponding color value in the floating-point representation of the first coordinate value. This helps to ensure that the scheme of encoding color information in world coordinates in this application will not cause a large offset to the world coordinates in some scenarios.

[0168] The following section will provide a more detailed explanation of the impact of encoding color information in world coordinates on world coordinates.

[0169] Because computers store floating-point numbers in binary, the total number of integer and fractional bits is finite. The more bits the integer bits occupy (the more numbers can be represented), the fewer bits the fractional bits occupy (the fewer numbers can be represented). Therefore, this application needs to consider whether encoding color information for a large desired coordinate value will cause a significant offset, potentially preventing the desired coordinate value from being obtained.

[0170] Taking single-precision floating-point representation in computers as an example, and taking the desired coordinate value as an integer 8000, the binary representation of 8000 is: 1111101000000, which is a 13-bit binary number. Normalizing 8000 results in: 1.111101000000 × 2 12The decimal point is shifted 12 places to the left. Therefore, the exponent of the floating-point representation of 8000 indicates a value of 12 + 127 = 139 (stored in binary as 10001011). The mantissa of 8000 is the binary digit to the right of the decimal point of the normalized result: 111101000000 (12 bits), while the mantissa of a single-precision floating-point number is 23 bits. Therefore, the mantissa of the floating-point representation of 8000 is the following 23-bit binary number: 11110100000000000000000. The first 12 bits of this binary number correspond to the integer value 8000. The technical solution provided in this application only modifies the last N bits of the above binary number (e.g., N is 5), which only adds a very small decimal to the integer 8000, and the impact on the actual value of the final coordinate is negligible.

[0171] However, as the size of the virtual scene increases, the desired coordinate values ​​may also increase. In this case, if N is chosen to be large, it could lead to significant offsets in the coordinate values. Taking a desired coordinate value of 80000 as an example, the binary representation of 80000 is 10011100010000000, which is a 17-bit binary number. Normalizing 80000 results in: 1.0011100010000000 × 2 16 The mantissa of 80000 is the binary number to the right of the decimal point in the normalized result: 0011100010000000 (16 bits), while the mantissa of a single-precision floating-point number is 23 bits. Therefore, the mantissa of the floating-point representation of 8000 is the following 23-bit binary number: 00111000100000000000000. The first 16 bits of this binary number correspond to the integer value 80000. In this case, if N=7, that is, modifying the last 7 bits of this binary number, a non-negligible decimal will be added to the integer 80000, causing the actual value of the final coordinates to deviate unexpectedly. Therefore, technicians need to consider the actual size of the virtual scene, i.e., the size of the maximum possible coordinate value in the virtual scene, and flexibly select the value of N.

[0172] In some embodiments, the value of N is negatively correlated with the size of the virtual scene in the first direction.

[0173] In some embodiments, the size of the virtual scene in the first direction can be represented by the maximum coordinate value obtained by the virtual scene in the first direction.

[0174] For example, the larger the maximum coordinate value obtained by the virtual scene in the first direction, the smaller N is.

[0175] In some embodiments, the value of R is negatively correlated with the size of the virtual scene in the second direction.

[0176] In some embodiments, the value of T is negatively correlated with the size of the virtual scene in the third direction.

[0177] In some embodiments, N = R = T, the value of N is negatively correlated with the size of the virtual scene in the first direction, and the size of the virtual scene in the first direction is greater than the size of the virtual scene in the second direction, and the size of the virtual scene in the first direction is greater than the size of the virtual scene in the third direction.

[0178] In the above embodiment, the value of N is negatively correlated with the size of the virtual scene in the first direction. That is to say, when the size of the virtual scene in the first direction is large, the floating-point representation of the first coordinate value will use fewer mantissa bits to carry the color, thereby avoiding the first coordinate value from deviating from the expected coordinate value.

[0179] In some embodiments, the world coordinates of the first object include P coordinate values, and the representation to be processed includes the floating-point representation of each of the P coordinate values, where P is an integer greater than 1. The color information of the first object includes the color values ​​corresponding to the first object in Q color channels, where Q is a positive integer. P and Q can be the same or different, and this application does not limit this.

[0180] In some embodiments, a floating-point representation of one of the P coordinate values ​​is used to carry the color values ​​corresponding to at least two color channels of the first object in the Q color channels.

[0181] For example, the P coordinate values ​​include a first coordinate value and a second coordinate value, and the Q color channels include a first color channel, a second color channel, and a third color channel. The floating-point number of the first coordinate value represents the color value of the first object corresponding to the first color channel and the second color channel, respectively, and the floating-point number of the second coordinate value represents the color value of the first object corresponding to the third color channel.

[0182] In some embodiments, the color value corresponding to one of the Q color channels of the first object is carried by the floating-point representation of at least two of the P coordinate values.

[0183] For example, the P coordinate values ​​include a first coordinate value and a second coordinate value, and the Q color channels include a first color channel, a second color channel, and a third color channel. Four bits of the last six bits of the floating-point representation of the first coordinate value are used to carry the color value of the first object corresponding to the first color channel; four bits of the last six bits of the floating-point representation of the second coordinate value are used to carry the color value of the first object corresponding to the second color channel; the remaining two bits of the last six bits of the floating-point representation of the first coordinate value, and the remaining two bits of the last six bits of the floating-point representation of the second coordinate value are used to carry the color value of the first object corresponding to the third color channel.

[0184] In the above embodiments, the world coordinates of the first object and its color channels are not strictly one-to-one, allowing this solution to support more application scenarios. For example, in some games, a 2D virtual scene is presented, where the world coordinates of the first object only have two coordinate values, but the color of the first object in the virtual scene is still represented by three color channels. In this case, the above solution is more suitable.

[0185] The following section will introduce an embodiment of the encoding scheme (information processing method) corresponding to the decoding scheme (object rendering method) provided above. For details not described in the information processing method embodiment below, please refer to the object rendering method embodiment above. The two are interchangeable.

[0186] Please refer to Figure 7 The diagram illustrates a flowchart of an information processing method provided in one embodiment of this application. The execution entity for each step of this method can be a computer device, which may be the editing device 20 described in the above embodiment. The method may include at least one of the following steps (710-730).

[0187] Step 710: Obtain the world coordinates and color information of the first object in the virtual scene.

[0188] The world coordinates of the first object are used to indicate the position of the first object in the virtual scene, and the color information of the first object is used to indicate the color used to render the first object.

[0189] The world coordinates of the first object include at least two coordinate values.

[0190] In some embodiments, when the virtual scene is a two-dimensional virtual scene, the world coordinates of the first object include a first coordinate value and a second coordinate value. The first coordinate value indicates the position of the first object in a first direction within the virtual scene, and the second coordinate value indicates the position of the first object in a second direction within the virtual scene. In this embodiment, the first direction and the second direction are the directions of two axes of a two-dimensional coordinate system configured for the two-dimensional virtual scene.

[0191] In some embodiments, when the virtual scene is a three-dimensional virtual scene, the world coordinates of the first object include a first coordinate value, a second coordinate value, and a third coordinate value. The first coordinate value indicates the position of the first object in a first direction within the virtual scene, the second coordinate value indicates the position of the first object in a second direction within the virtual scene, and the third coordinate value indicates the position of the first object in a third direction within the virtual scene. In this embodiment, the first direction, the second direction, and the third direction are the directions of the three axes of a three-dimensional coordinate system configured for the virtual scene.

[0192] In some embodiments, the color information of the first object includes the color values ​​of the first object corresponding to at least one color channel.

[0193] In some embodiments, step 710 includes: displaying a virtual scene display screen, and when the brush range in the display screen covers the first object, obtaining the world coordinates of the first object and the color information of the first object, wherein the brush range is used to regionally set the color of objects in the virtual scene.

[0194] For example, please refer to Figure 8 The virtual scene editing interface 800 displays a virtual scene display screen. The virtual scene editing interface 800 displays a brush parameter configuration panel 801, which can be used to set the color of the object covered by the brush range 802, and to set the size of the brush range 802. In some embodiments, the virtual scene editing interface 800 displays a brush control (…). Figure 7 (Not shown in the image), in response to an operation on the brush control (such as a click), the brush range 802 and the brush parameter configuration panel 801 are displayed. The user can change the position of the brush range 802 by clicking on the display screen of the virtual scene and dragging the brush range 802.

[0195] In some embodiments, please refer to Figure 9 The virtual scene is divided into at least two regions 91. The objects included in each region 91 can be pre-defined. After setting the brush range, the region 91 overlapping with the brush range can be used as the detection area, and the objects included in the detection area can be used as the detection objects. If the distance between the detection object and the center point of the brush range is less than the radius of the brush range, it can be determined that the brush range covers the detection object. In this way, objects within the brush range can be detected quickly.

[0196] In some embodiments, step 710 includes: displaying a virtual scene display screen; in response to an operation on a first object in the display screen, displaying a parameter setting interface for the first object; and in response to an operation on the parameter setting interface, obtaining the world coordinates and color information of the first object.

[0197] The parameter setting interface for the first object is used to specifically set or adjust the parameters of the first object.

[0198] For example, please refer to Figure 10 The parameter setting interface 102 of the first object 101 supports setting the name, world coordinates, size, color, etc. of the first object. The operation of the parameter setting interface can be the operation of changing the color of the first object 101 in the parameter setting interface 102.

[0199] In the above embodiments, users can quickly trigger the coding process provided in this application embodiment to adjust the color of the first object through regional coloring operations or coloring operations targeting the first object, thereby improving scene editing efficiency.

[0200] Please refer to Figure 11 In some embodiments, the method further includes: displaying a color preset list 110, which displays at least one color option 111, wherein the color option 11 records colors that have been used in the virtual scene. In response to an operation (such as a click) on a first color option among the at least one color option 111, the color information indicating the color recorded by the first color option is determined as the color information of a first object. Selecting a color from the used colors to color the first object can improve the efficiency and accuracy of color adjustment.

[0201] Step 720: Based on the color information of the first object, encode the world coordinates of the first object to obtain the encoded world coordinates of the first object.

[0202] The encoded world coordinates of the first object are used to carry the color information of the first object.

[0203] The world coordinates of the first object include at least two coordinate values. The encoded world coordinates of the first object include at least two encoded coordinate values. For example, the at least two encoded coordinate values ​​include a first encoded coordinate value, a second encoded coordinate value, and a third encoded coordinate value.

[0204] In some embodiments, please refer to Figure 12 Step 720 includes at least one of the following steps 722 to 724.

[0205] Step 722: Based on the color information of the first object, change at least one bit of the mantissa of the representation to be processed to obtain the encoded representation to be processed, which is a floating-point representation of the world coordinates of the first object.

[0206] In some embodiments, the representation to be processed includes the floating-point representations of each of the above at least two coordinate values.

[0207] The encoded representation to be processed includes the floating-point representations of at least two encoded coordinate values.

[0208] In some embodiments, prior to step 722, the world coordinates of the first object are converted from decimal to binary floating-point numbers to obtain the representation to be processed.

[0209] In some embodiments, the at least two coordinate values ​​are converted from decimal to binary floating-point numbers to obtain the floating-point representations of the at least two coordinate values ​​respectively.

[0210] For example, please refer to Figure 13 The first coordinate value is converted from decimal to binary floating-point number to obtain the floating-point representation of the first coordinate value.

[0211] Step 724: Based on the encoded representation to be processed, obtain the encoded world coordinates of the first object.

[0212] In the above embodiment, the color information of the first object is encoded into the mantissa of the floating-point representation of the world coordinates of the first object. This allows for the utilization of the storage principle of binary floating-point numbers in computers to minimize the impact of encoding the color information of the first object on the position of the first object indicated by the world coordinates of the first object.

[0213] In some embodiments, step 724 includes: converting the encoded representation to be processed from binary floating-point numbers to decimal numbers to obtain the encoded world coordinates of the first object.

[0214] In some embodiments, the floating-point representations of the at least two encoded coordinate values ​​are converted from binary floating-point numbers to decimal numbers to obtain the at least two encoded coordinate values.

[0215] In some scenarios, computer devices cannot directly perform bitwise operations on the decimal values ​​of the world coordinates of the first object. The above conversion steps convert the world coordinates of the first object into a floating-point representation that supports bitwise operations, ensuring the smooth progress of the encoding process. Furthermore, this ensures that the encoded world coordinates of the first object can still intuitively indicate its position using decimal values.

[0216] For example, please refer to Figure 13 The floating-point representation of the encoded first coordinate value is converted from binary floating-point number to decimal to obtain the encoded first coordinate value.

[0217] Step 730: Replace the world coordinates of the first object with the encoded world coordinates of the first object.

[0218] In some embodiments, step 730 includes replacing the at least two coordinate values ​​with at least two encoded coordinate values. For example, a first coordinate value is replaced with an encoded first coordinate value, a second coordinate value is replaced with an encoded second coordinate value, and a third coordinate value is replaced with an encoded third coordinate value.

[0219] The technical solution provided in this application encodes the color information of the first object in world coordinates, which indicate the position of the first object in the virtual scene. Therefore, before rendering the first object, the color information of the first object can be directly decoded from its world coordinates. Using this method, it is unnecessary to separately configure the color information of the first object in its material information, thereby reducing the data redundancy of the material information used for rendering the first object.

[0220] In some embodiments, the world coordinates of the first object include M coordinate values, and the representation to be processed includes the floating-point representation of each of the M coordinate values, where M is an integer greater than 1.

[0221] The color information of the first object includes the color values ​​corresponding to the first object in each of the M color channels.

[0222] The floating-point representation of the different coordinate values ​​among the M coordinate values ​​is used to carry the color values ​​corresponding to the different color channels of the first object in the M color channels.

[0223] For example, M = 3, and the world coordinates of the first object include the first coordinate value, the second coordinate value, and the third coordinate value described above. The M color channels include a first color channel (e.g., R channel), a second color channel (e.g., G channel), and a third color channel (e.g., B channel). The floating-point representation of the first coordinate value is used to carry the color value of the first object in the first color channel, the floating-point representation of the second coordinate value is used to carry the color value of the first object in the second color channel, and the floating-point representation of the third coordinate value is used to carry the color value of the first object in the third color channel.

[0224] In the above embodiment, the M coordinate values ​​correspond one-to-one with the color values ​​of the first object in the M color channels (for example, in a 3D virtual scene, the three coordinate values ​​of the world coordinates correspond one-to-one with the three color channels RGB). That is to say, the color values ​​of the first object in the M color channels are encoded one-to-one into the floating-point representation of each of the M coordinate values. This encoding method has low implementation complexity.

[0225] In some embodiments, the M coordinate values ​​include the aforementioned first coordinate values, and the M color channels include the aforementioned first color channels. Step 722 includes the following sub-steps:

[0226] The last N bits of the floating-point representation of the first coordinate value are replaced with the first numerical value to obtain the encoded floating-point representation of the first coordinate value. The first numerical value has a mapping relationship with the color value corresponding to the first object in the first color channel.

[0227] In some embodiments, please refer to Figure 13Before the above sub-step, it also includes: mapping the color value corresponding to the first object in the first color channel to a first numerical value.

[0228] In some embodiments, the color value of each color channel includes 256 values, such as 0, 1 / 256, 2 / 256, ..., 255 / 256. The color value corresponding to the first object in the first color channel is multiplied by 2. N Then, perform a rounding operation (e.g., round to the nearest whole number) to obtain the first value. For example, N = 5, and the color value of the first object in the first color channel is 49 / 256. Multiply this by 2. 5 The result is 6.125. After rounding 6.125 by 4, the first value 6 is obtained. Its N-bit binary representation is 00110.

[0229] In the above embodiment, only the last N bits of the mantissa of the floating-point representation of the first coordinate value are used to encode the first value. That is to say, this application actually uses the N bits that have the least impact on the value indicated by the floating-point representation to carry the corresponding color value. Therefore, the above method can make the influence of the N bits used to determine the color value on the position as small as possible when all bits of the floating-point representation of the first coordinate value are used to determine the corresponding position (even if these N bits are changed, there will be no perceptible shift to the position).

[0230] It should be noted that, among the M coordinate values ​​other than the first coordinate value, the method for encoding the color values ​​of the first object in color channels other than the first color channel can refer to the sub-steps included in step 722 above, which will not be described in detail below.

[0231] In some embodiments, the M coordinate values ​​include the aforementioned second coordinate values, and the M color channels also include the aforementioned second color channels. Step 722 further includes the following sub-steps:

[0232] The value indicated by the last R bits of the floating-point representation of the second coordinate value is replaced with the second numerical value to obtain the encoded floating-point representation of the second coordinate value. The second numerical value has a mapping relationship with the color value corresponding to the first object in the second color channel.

[0233] In some embodiments, prior to the above sub-steps, the method further includes mapping the color value corresponding to the first object in the second color channel to a second numerical value.

[0234] In some embodiments, the M coordinate values ​​include the aforementioned third coordinate values, and the M color channels also include the aforementioned third color channels. Step 722 further includes the following sub-steps:

[0235] The value indicated by the last R bits of the floating-point representation of the third coordinate value is replaced with the third numerical value to obtain the encoded floating-point representation of the third coordinate value. The third numerical value has a mapping relationship with the color value corresponding to the first object in the third color channel.

[0236] In some embodiments, prior to the above sub-steps, the method further includes mapping the color value corresponding to the first object in the third color channel to a third numerical value.

[0237] In some embodiments, N is a positive integer less than or equal to 8.

[0238] In some embodiments, the value of N is negatively correlated with the size of the virtual scene in the first direction.

[0239] In some embodiments, the world coordinates of the first object include P coordinate values, and the representation to be processed includes the floating-point representation of each of the P coordinate values, where P is an integer greater than 1. The color information of the first object includes the color values ​​corresponding to the first object in Q color channels, where Q is a positive integer. P and Q can be the same or different, and this application does not limit this.

[0240] In some embodiments, a floating-point representation of one of the P coordinate values ​​is used to carry the color values ​​corresponding to at least two color channels of the first object in the Q color channels.

[0241] In some embodiments, the color value corresponding to one of the Q color channels of the first object is carried by the floating-point representation of at least two of the P coordinate values.

[0242] In the above embodiments, the world coordinates and color channels of the first object are not strictly one-to-one. That is, a color value can be encoded in a split manner across at least two coordinate values, or at least two color values ​​can be encoded in one coordinate value, enabling this solution to support more application scenarios. For example, in some games, a 2D virtual scene is presented, where the world coordinates of the first object only have two coordinate values, but the color of the first object in the virtual scene is still represented by three color channels. In this case, the above solution is more suitable.

[0243] In some embodiments, please refer to Figure 14 The above information processing method further includes at least one of the following steps 1410 to 1430.

[0244] Step 1410: In response to moving the second object in the virtual scene from the first position to the second position, obtain the first world coordinates and the color information of the second object. The first world coordinates are used to indicate the second position, and the color information of the second object is used to indicate the color used to render the second object.

[0245] In some embodiments, after setting the color used to render the second object, the color information of the second object is stored, and the color information of the second object indicates the color.

[0246] Step 1420: Encode the first world coordinates based on the color information of the second object to obtain the encoded first world coordinates.

[0247] The specific method of encoding the first world coordinates based on the color information of the second object is similar to the method of encoding the world coordinates of the first object based on the color information of the first object in the above embodiment, and will not be described again in this application.

[0248] Step 1430: Replace the world coordinates of the second object with the encoded first world coordinates.

[0249] The world coordinates of the second object are used to indicate the position of the second object in the virtual scene.

[0250] In a virtual scene, after a user paints or sets a color for an object, there may be a need to move the object for editing later. If no processing is done when moving the object, the color of the object will change due to the change in world coordinates, and the user will have to paint the color again, which will greatly reduce the editing efficiency.

[0251] To avoid the aforementioned problems, the above embodiment stores the color information of the second object, and updates this color information whenever the user adjusts the color of the second object. Then, when the user moves the second object, the color information is re-encoded into the world coordinates of the second object, thereby ensuring that the color of the second object remains consistent before and after movement.

[0252] The second object mentioned above may be the same object as the first object mentioned above, or it may be a different object. This application does not limit this.

[0253] In some embodiments, please refer to Figure 15 The above information processing method further includes at least one of the following steps 1510 to 1530.

[0254] Step 1510: In response to adding a third object to a third position in the virtual scene, obtain second world coordinates and preset color information. The second world coordinates are used to indicate the third position, and the preset color information is used to indicate the color used to render the newly added object in the virtual scene.

[0255] In some embodiments, the preset color information is set by the user.

[0256] In some embodiments, an editing interface for a virtual scene is displayed, which includes a default color configuration control used to configure preset color information. In response to an operation on the default color configuration control, the preset color information is determined.

[0257] For example, in response to an operation on the default color configuration control, at least two default color options are displayed, and in response to an operation on the first default color option among the at least two default color options (different default color options correspond to different colors), preset color information is determined, and the color indicated by the preset color information corresponds to the first default color option.

[0258] Step 1520: Encode the second world coordinates based on the preset color information to obtain the encoded second world coordinates.

[0259] The specific method of encoding the second world coordinates based on the preset color information is similar to the method of encoding the world coordinates of the first object based on the color information of the first object in the above embodiment, and will not be described again in this application.

[0260] Step 1530: Replace the world coordinates of the third object with the encoded second world coordinates.

[0261] The world coordinates of the third object are used to indicate the position of the third object in the virtual scene.

[0262] During the editing of a virtual scene, users not only need to color existing objects but also need to add new objects. However, without processing, the color of newly added objects will depend on their world coordinates at the time of addition. The method described above encodes preset color information into the world coordinates of a third object when it is added to the virtual scene, thus ensuring that the color of newly added objects in the virtual scene is controllable.

[0263] The aforementioned third object may be the same object as the first object mentioned above, or it may be a different object; this application does not limit this.

[0264] In some embodiments, after completing the above information processing method, the editing device 20 continues to execute the object rendering method provided in the above embodiments, thereby displaying the editing effect of the virtual scene to the user in real time.

[0265] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0266] Please refer to Figure 16This diagram illustrates a block diagram of an object rendering apparatus according to an embodiment of this application. The apparatus has the function of implementing the above-described object rendering method; this function can be implemented in hardware or by hardware executing corresponding software. The apparatus can be a computer device or can be installed within a computer device. The apparatus 1600 includes: an acquisition module 1610, a decoding module 1620, and a rendering module 1630.

[0267] The acquisition module 1610 is used to acquire the world coordinates of a first object in a virtual scene. The world coordinates of the first object are used to indicate the position of the first object in the virtual scene, and the world coordinates of the first object carry the color information of the first object.

[0268] The decoding module 1620 is used to decode the world coordinates of the first object to obtain the color information of the first object.

[0269] The rendering module 1630 is used to render the first object based on the color information of the first object.

[0270] In some embodiments, the decoding module 1620 obtains the color information of the first object using at least one bit of the mantissa of the representation to be processed, wherein the representation to be processed is a floating-point representation of the world coordinates of the first object.

[0271] In some embodiments, the world coordinates of the first object include M coordinate values, and the representation to be processed includes the floating-point representation of each of the M coordinate values, where M is an integer greater than 1; the color information of the first object includes the color values ​​corresponding to the first object in the M color channels respectively; the floating-point representations of the different coordinate values ​​among the M coordinate values ​​are used to carry the color values ​​corresponding to the different color channels of the first object in the M color channels.

[0272] In some embodiments, the M coordinate values ​​include a first coordinate value, and the M color channels include a first color channel;

[0273] The decoding module 1620 is used to determine the value indicated by the last N bits of the mantissa of the floating-point representation of the first coordinate value as a first value, where N is a positive integer, and all bits of the floating-point representation of the first coordinate value are used to determine the position of the first object in the first direction in the virtual scene; based on the first value, the color value corresponding to the first object in the first color channel is obtained.

[0274] In some embodiments, N is a positive integer less than or equal to 8.

[0275] In some embodiments, the value of N is negatively correlated with the size of the virtual scene in the first direction.

[0276] In some embodiments, the world coordinates of the first object include P coordinate values, the representation to be processed includes the floating-point representation of each of the P coordinate values, where P is an integer greater than 1, and the color information of the first object includes the color values ​​corresponding to the first object in Q color channels, where Q is a positive integer; wherein, the floating-point representation of one of the P coordinate values ​​is used to carry the color values ​​corresponding to at least two color channels of the first object in the Q color channels; or, the color value corresponding to one color channel of the first object in the Q color channels is carried by the floating-point representation of at least two of the P coordinate values.

[0277] In some embodiments, the decoding module 1620 is further configured to convert the world coordinates of the first object from decimal to binary floating-point numbers to obtain the representation to be processed.

[0278] In some embodiments, the rendering module 1630 is configured to batch render the at least two objects based on the color information of the at least two objects respectively; wherein the at least two objects include the first object, the at least two objects have the same geometric structure, and at least one of the at least two objects has different color information from the first object.

[0279] Please refer to Figure 17 This diagram illustrates a block diagram of an information processing apparatus according to an embodiment of this application. The apparatus has the function of implementing the aforementioned information processing method; this function can be implemented in hardware or by hardware executing corresponding software. The apparatus can be a computer device or can be installed within a computer device. The apparatus 1700 includes: an acquisition module 1710, an encoding module 1720, and a replacement module 1730.

[0280] The acquisition module 1710 is used to acquire the world coordinates of a first object in a virtual scene and the color information of the first object. The world coordinates of the first object are used to indicate the position of the first object in the virtual scene, and the color information of the first object is used to indicate the color used to render the first object.

[0281] The encoding module 1720 is used to encode the world coordinates of the first object based on the color information of the first object, so as to obtain the encoded world coordinates of the first object, wherein the encoded world coordinates of the first object carry the color information of the first object.

[0282] Replacement module 1730 is used to replace the world coordinates of the first object with the encoded world coordinates of the first object.

[0283] In some embodiments, the encoding module 1720 is configured to change at least one bit of the mantissa of the representation to be processed based on the color information of the first object to obtain an encoded representation to be processed, wherein the representation to be processed is a floating-point representation of the world coordinates of the first object; and to obtain the encoded world coordinates of the first object based on the encoded representation to be processed.

[0284] In some embodiments, the world coordinates of the first object include M coordinate values, and the representation to be processed includes the floating-point representation of each of the M coordinate values, where M is an integer greater than 1; the color information of the first object includes the color values ​​corresponding to the first object in the M color channels respectively; the floating-point representations of the different coordinate values ​​among the M coordinate values ​​are used to carry the color values ​​corresponding to the different color channels of the first object in the M color channels.

[0285] In some embodiments, the M coordinate values ​​include a first coordinate value, and the M color channels include a first color channel.

[0286] The encoding module 1720 is used to replace the value indicated by the last N bits of the floating-point representation of the first coordinate value with a first numerical value to obtain the encoded floating-point representation of the first coordinate value. The first numerical value has a mapping relationship with the color value corresponding to the first object in the first color channel.

[0287] In some embodiments, the world coordinates of the first object include P coordinate values, the representation to be processed includes the floating-point representation of each of the P coordinate values, where P is an integer greater than 1, and the color information of the first object includes the color values ​​corresponding to the first object in Q color channels, where Q is an integer greater than 1; wherein, the floating-point representation of one of the P coordinate values ​​is used to carry the color values ​​corresponding to at least two color channels of the first object in the Q color channels; or, the color value corresponding to one color channel of the first object in the Q color channels is carried by the floating-point representation of at least two of the P coordinate values.

[0288] In some embodiments, the encoding module 1720 is used to convert the world coordinates of the first object from decimal to binary floating-point numbers to obtain the representation to be processed; and to convert the encoded representation to be processed from binary floating-point numbers to decimal numbers to obtain the encoded world coordinates of the first object.

[0289] In some embodiments, the acquisition module 1710 is configured to display a display screen of the virtual scene, and, when the brush range in the display screen covers the first object, acquire the world coordinates and color information of the first object, wherein the brush range is used to regionally set the color of objects in the virtual scene; or, display a display screen of the virtual scene, and, in response to an operation on the first object in the display screen, display a parameter setting interface for the first object, and, in response to an operation on the parameter setting interface, acquire the world coordinates and color information of the first object.

[0290] In some embodiments, the acquisition module 1710 is further configured to acquire first world coordinates and color information of the second object in response to moving the second object in the virtual scene from a first position to a second position, wherein the first world coordinates are used to indicate the second position and the color information of the second object is used to indicate the color used to render the second object.

[0291] The encoding module 1720 is also used to encode the first world coordinates based on the color information of the second object to obtain the encoded first world coordinates.

[0292] The replacement module 1730 is further configured to replace the world coordinates of the second object with the encoded first world coordinates, the world coordinates of the second object being used to indicate the position of the second object in the virtual scene.

[0293] In some embodiments, the acquisition module 1710 is further configured to acquire second world coordinates and preset color information in response to adding a third object to a third position in the virtual scene, wherein the second world coordinates are used to indicate the third position and the preset color information is used to indicate the color used to render the newly added object in the virtual scene.

[0294] The encoding module 1720 is also used to encode the second world coordinates based on the preset color information to obtain the encoded second world coordinates.

[0295] The replacement module 1730 is further configured to replace the world coordinates of the third object with the encoded second world coordinates, the world coordinates of the third object being used to indicate the position of the third object in the virtual scene.

[0296] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0297] Please refer to Figure 18 The diagram illustrates a structural block diagram of a computer device provided in one embodiment of this application.

[0298] Typically, computer device 1800 includes a processor 1801 and a memory 1802.

[0299] Processor 1801 may include one or at least two processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1801 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1801 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1801 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1801 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0300] The memory 1802 may include one or at least two computer-readable storage media, which may be tangible and non-transitory. The memory 1802 may also include high-speed random access memory and non-volatile memory, such as one or at least two disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1802 stores a computer program that is loaded and executed by the processor 1801 to implement the object rendering method or the information processing method described above.

[0301] Those skilled in the art will understand that Figure 18 The structure shown does not constitute a limitation on the computer device 1800, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0302] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein a computer program is stored therein, which, when executed by a processor, implements the object rendering method described above or the information processing method described above.

[0303] Optionally, the computer-readable storage medium may include: ROM (Read-Only Memory), RAM (Random Access Memory), SSD (Solid State Drives), or optical disc, etc. The random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).

[0304] In an exemplary embodiment, a computer program product is also provided, comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the object rendering method or the information processing method described above.

[0305] It should be noted that the data collection and processing in this application should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0306] It should be understood that "at least two" as mentioned herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.

[0307] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. An object rendering method, characterized in that, The method includes: Obtain the world coordinates of a first object in the virtual scene. The world coordinates of the first object are used to indicate the position of the first object in the virtual scene, and the world coordinates of the first object carry the color information of the first object. Decode the world coordinates of the first object to obtain the color information of the first object; The first object is rendered based on its color information.

2. The method according to claim 1, characterized in that, Decoding the world coordinates of the first object to obtain its color information includes: The color information of the first object is obtained based on at least one of the mantissa bits of the representation to be processed, wherein the representation to be processed is a floating-point representation of the world coordinates of the first object.

3. The method according to claim 2, characterized in that, The world coordinates of the first object include M coordinate values, and the representation to be processed includes the floating-point representation of each of the M coordinate values, where M is an integer greater than 1; The color information of the first object includes the color values ​​of the first object in each of the M color channels; The floating-point representations of the different coordinate values ​​among the M coordinate values ​​are used to carry the color values ​​corresponding to different color channels of the first object in the M color channels.

4. The method according to claim 3, characterized in that, The M coordinate values ​​include the first coordinate value, and the M color channels include the first color channel; Obtaining the color information of the first object based on at least one bit of the mantissa of the representation to be processed includes: The value indicated by the last N bits of the floating-point representation of the first coordinate value is determined as the first value, where N is a positive integer. All bits of the floating-point representation of the first coordinate value are used to determine the position of the first object in the first direction in the virtual scene. Based on the first value, the color value of the first object in the first color channel is obtained.

5. The method according to claim 4, characterized in that, N is a positive integer less than or equal to 8.

6. The method according to claim 4 or 5, characterized in that, The value of N is negatively correlated with the size of the virtual scene in the first direction.

7. The method according to any one of claims 1 to 6, characterized in that, Rendering the first object based on its color information includes: Based on the color information of at least two objects, render the at least two objects in batches; The at least two objects include the first object, the at least two objects have the same geometric structure, and at least one of the at least two objects has different color information from the first object.

8. An information processing method, characterized in that, The method includes: Obtain the world coordinates and color information of the first object in the virtual scene. The world coordinates of the first object are used to indicate the position of the first object in the virtual scene, and the color information of the first object is used to indicate the color used to render the first object. Based on the color information of the first object, the world coordinates of the first object are encoded to obtain the encoded world coordinates of the first object, and the encoded world coordinates of the first object carry the color information of the first object. Replace the world coordinates of the first object with the encoded world coordinates.

9. The method according to claim 8, characterized in that, Encoding the world coordinates of the first object based on its color information includes: Based on the color information of the first object, at least one bit of the mantissa of the representation to be processed is changed to obtain the encoded representation to be processed, wherein the representation to be processed is a floating-point representation of the world coordinates of the first object; Based on the encoded representation to be processed, the encoded world coordinates of the first object are obtained.

10. The method according to claim 9, characterized in that, The world coordinates of the first object include M coordinate values, and the representation to be processed includes the floating-point representation of each of the M coordinate values, where M is an integer greater than 1; The color information of the first object includes the color values ​​of the first object in each of the M color channels; The floating-point representations of the different coordinate values ​​among the M coordinate values ​​are used to carry the color values ​​corresponding to different color channels of the first object in the M color channels.

11. The method according to claim 10, characterized in that, The M coordinate values ​​include the first coordinate value, and the M color channels include the first color channel; The step of changing at least one bit of the mantissa of the representation to be processed based on the color information of the first object to obtain the encoded representation to be processed includes: The last N bits of the floating-point representation of the first coordinate value are replaced with the first numerical value to obtain the encoded floating-point representation of the first coordinate value. The first numerical value has a mapping relationship with the color value corresponding to the first object in the first color channel.

12. The method according to any one of claims 8 to 11, characterized in that, The method further includes: Convert the world coordinates of the first object from decimal to binary floating-point numbers to obtain the representation to be processed; The process of obtaining the encoded world coordinates of the first object based on the encoded representation to be processed includes: The encoded representation to be processed is converted from binary floating-point number to decimal to obtain the encoded world coordinates of the first object.

13. The method according to any one of claims 8 to 12, characterized in that, The step of obtaining the world coordinates of the first object in the virtual scene and the color information of the first object includes: Display the virtual scene's display screen. When the brush range in the display screen covers the first object, obtain the world coordinates of the first object and the color information of the first object. The brush range is used to set the color of objects in the virtual scene in a regional manner. or, Display the virtual scene's display screen, and in response to an operation on the first object in the display screen, display the parameter setting interface of the first object, and in response to an operation on the parameter setting interface, obtain the world coordinates and color information of the first object.

14. The method according to any one of claims 8 to 13, characterized in that, The method further includes: In response to moving a second object in the virtual scene from a first position to a second position, first world coordinates and color information of the second object are obtained, wherein the first world coordinates are used to indicate the second position and the color information of the second object is used to indicate the color used to render the second object; Based on the color information of the second object, the first world coordinates are encoded to obtain the encoded first world coordinates; The world coordinates of the second object are replaced with the encoded first world coordinates, which are used to indicate the position of the second object in the virtual scene.

15. The method according to any one of claims 8 to 14, characterized in that, The method further includes: In response to adding a third object to a third position in the virtual scene, second world coordinates and preset color information are obtained, wherein the second world coordinates are used to indicate the third position and the preset color information is used to indicate the color used to render the newly added object in the virtual scene; Based on the preset color information, the second world coordinates are encoded to obtain the encoded second world coordinates; The world coordinates of the third object are replaced with the encoded second world coordinates, which are used to indicate the position of the third object in the virtual scene.

16. An object rendering apparatus, characterized in that, The device includes: The acquisition module is used to acquire the world coordinates of a first object in a virtual scene. The world coordinates of the first object are used to indicate the position of the first object in the virtual scene, and the world coordinates of the first object carry the color information of the first object. The decoding module is used to decode the world coordinates of the first object to obtain the color information of the first object; The rendering module is used to render the first object based on the color information of the first object.

17. An information processing device, characterized in that, The device includes: The acquisition module is used to acquire the world coordinates and color information of a first object in a virtual scene. The world coordinates of the first object are used to indicate the position of the first object in the virtual scene, and the color information of the first object is used to indicate the color used to render the first object. An encoding module is used to encode the world coordinates of the first object based on the color information of the first object, so as to obtain the encoded world coordinates of the first object, wherein the encoded world coordinates of the first object carry the color information of the first object. The replacement module is used to replace the world coordinates of the first object with the encoded world coordinates of the first object.

18. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program that is loaded and executed by the processor to implement the method as claimed in any one of claims 1 to 7, or to implement the method as claimed in any one of claims 8 to 15.

19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is loaded and executed by a processor to implement the method as claimed in any one of claims 1 to 7, or to implement the method as claimed in any one of claims 8 to 15.

20. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium, which a processor reads from and executes to implement the method as claimed in any one of claims 1 to 7, or to implement the method as claimed in any one of claims 8 to 15.