Information processing method and device, electronic equipment and readable storage medium
By rendering the target object in the three-dimensional virtual scene, determining the position and size information, cropping the blank edges, and generating the text file, the problem of complexity and low efficiency in generating two-dimensional project text files in the existing technology is solved, and automation and efficiency are achieved. Text file generation.
Patent Information
- Application Number
- CN202410916838.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-10-18
Smart Images

Figure CN118799470A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an information processing method, an information processing device, an electronic device, and a computer-readable storage medium. Background Art
[0002] When developing a 2D (two-dimensional) project, three-dimensional virtual resources are usually created first. However, since a two-dimensional effect needs to be achieved in the end, a text file that can be used to generate two-dimensional virtual resources corresponding to the three-dimensional virtual resources needs to be generated after the three-dimensional virtual resources are created.
[0003] Currently, production staff usually manually render three-dimensional virtual resources to obtain images containing three-dimensional virtual resources, and then manually adjust and correct them in a layer processing application (such as PhotoShop) before exporting them as text files that can be used to generate two-dimensional virtual resources corresponding to the three-dimensional virtual resources. This process is cumbersome and complicated, requires cross-application implementation, and is inefficient in generating text files that can be used for 2D projects. Summary of the invention
[0004] The present disclosure provides an information processing method, an information processing device, an electronic device, and a computer-readable storage medium to solve or at least partially solve the above-mentioned problems, as follows.
[0005] In a first aspect, the present disclosure provides a data processing method, the method comprising:
[0006] Acquire a target virtual object to be rendered, wherein the target virtual object is a virtual object included in a three-dimensional virtual scene;
[0007] Rendering the target virtual object to obtain an image containing the target virtual object;
[0008] Determine first image information representing the position and size of the target virtual object in the image;
[0009] Cutting the blank edge of the image according to the first image information to obtain a sub-image containing the target virtual object;
[0010] According to the sub-image and the first image information, a text file is generated. In a second aspect, the present disclosure further provides an information processing device, the device comprising:
[0011] An object acquisition module, used to acquire a target virtual object to be rendered, wherein the target virtual object is a virtual object included in a three-dimensional virtual scene;
[0012] An object rendering module, used for rendering the target virtual object to obtain an image containing the target virtual object;
[0013] An information determination module, used to determine first image information representing the position and size of the target virtual object in the image;
[0014] An image cropping module, configured to crop the blank edge of the image according to the first image information to obtain a sub-image containing the target virtual object;
[0015] The file generation module is used to generate a text file according to the sub-image and the first image information.
[0016] In a third aspect, the present disclosure further provides an electronic device, comprising: a processor, a memory, and computer program instructions stored in the memory and executable on the processor;
[0017] When the processor executes the computer program instructions, the information processing method described in the first aspect above is implemented.
[0018] In a fourth aspect, the present disclosure further provides a computer-readable storage medium, in which computer program instructions are stored. When the computer program instructions are executed by a processor, they are used to implement the information processing method described in the first aspect above.
[0019] The exemplary embodiments of the present disclosure have the following beneficial effects:
[0020] The information processing method provided by the present disclosure first obtains the target virtual object to be rendered in the three-dimensional virtual scene; then renders the target virtual object to obtain an image containing the target virtual object; then determines the first image information representing the position and size of the target virtual object in the image; cuts the blank edge of the image according to the first image information to obtain a sub-image containing the target virtual object; and then generates a text file according to the sub-image and the first image information. In the present disclosure, the three-dimensional virtual resource in the three-dimensional virtual scene can be rendered to obtain an image containing the three-dimensional virtual resource, and the image information about the position and size of the three-dimensional virtual resource can be recorded, and then a text file can be generated containing the image of the three-dimensional virtual resource and the recorded image information, and the text file can be used to generate the two-dimensional virtual resource corresponding to the three-dimensional virtual resource. The above process does not need to be implemented across applications, which reduces the complexity of generating text files and improves the efficiency of generating text files. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flow chart of an information processing method provided by one of the embodiments of the present disclosure;
[0022] Figure 2 is a schematic diagram of a rendering configuration interface provided by one of the embodiments of the present disclosure;
[0023] Figure 3 is a schematic diagram of detecting image pixel values provided by one of the embodiments of the present disclosure;
[0024] Figure 4 is a schematic diagram of a text file storing first image information provided by one embodiment of the present disclosure;
[0025] Figure 5 is a schematic diagram of a text file storing second image information provided by one embodiment of the present disclosure;
[0026] Figure 6 is a schematic diagram of a file output after rendering provided by one embodiment of the present disclosure;
[0027] Figure 7 is a schematic diagram of an image stitching result provided by one of the embodiments of the present disclosure;
[0028] Figure 8 is a block diagram of an information processing device provided by one of the embodiments of the present disclosure;
[0029] Fig. 9 It is a logical structure diagram of an electronic device for implementing information processing provided by one of the embodiments of the present disclosure. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present disclosure.
[0031] The terms "a", "an", "the" and "said" are used in this specification to indicate the presence of one or more elements / components / etc.; the terms "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first" and "second" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0032] It should be understood that in the embodiments of the present disclosure, "at least one" means one or more, and "more than one" means two or more. "And / or" is merely a way to describe the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "Including A, B and / or C" means including any one, any two, or any three of A, B, and C.
[0033] It should be understood that in the embodiments of the present disclosure, "B corresponding to A", "B corresponding to A", "A corresponds to B", or "B corresponds to A" means that B is associated with A, and B can be determined according to A. Determining B according to A does not mean that B is determined only according to A, and B can also be determined according to A and / or other information.
[0034] The present disclosure provides an information processing method, and the execution subject of the information processing method provided by the present disclosure can be an electronic device or a server. In one of the embodiments of the present disclosure, the electronic device can be a desktop computer, a laptop computer, a game console, a smart watch, a tablet computer, a mobile phone, a television, etc., or it can be other electronic devices, which are not specifically limited by the present disclosure. In one of the embodiments of the present disclosure, the server can be used to provide background services for the client of the application in the electronic device. For example, the server can be the background server of the above application. The server can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms, which are not specifically limited by the present application.
[0035] Figure 1 An information processing method provided by one embodiment of the present disclosure is shown. Figure 1 As shown, the method includes the following steps S101 to S105.
[0036] Step S101: obtaining a target virtual object to be rendered, wherein the target virtual object is a virtual object included in a three-dimensional virtual scene.
[0037] In one embodiment, the information processing method provided by the present disclosure can be applied to a digital content creation (DCC) toolset, which is a general term for a set of functions for making models and textures, including common tools for making models, such as Blender, 3D Max, Maya, Cinema 4D, Spine, etc.
[0038] Step S102: Rendering the target virtual object to obtain an image including the target virtual object.
[0039] In the present disclosure, a DCC toolset may be used to create a three-dimensional virtual scene, such as a three-dimensional game scene. The three-dimensional virtual scene may include virtual objects. Users may set the visibility of the virtual objects in the three-dimensional virtual scene. Virtual objects set to be visible may be rendered and displayed in a graphical user interface, while virtual objects set to be invisible (or hidden) will not be rendered.
[0040] In one of the optional implementations of the present disclosure, this step can be specifically implemented in the following manner, including: setting the display parameters of the target virtual object to be rendered in the three-dimensional virtual scene to be visible, and setting the display parameters of virtual objects other than the target virtual object in the three-dimensional virtual scene to be invisible, and retaining the lighting in the three-dimensional virtual scene; rendering the target virtual object with display parameters set to be visible, to obtain an image containing the target virtual object.
[0041] In this embodiment, the display parameters of the target virtual object to be rendered in the three-dimensional virtual scene can be set to be visible, and the display parameters of other virtual objects in the three-dimensional virtual scene that do not need to be rendered can be set to be invisible (or hidden), while retaining the lighting properties such as reflection in the three-dimensional virtual scene. Retaining the lighting can make the currently visible target virtual object produce corresponding shadows under the lighting of the three-dimensional virtual scene. Under this setting, the target virtual object whose display parameters are set to be visible can be rendered to obtain an image containing the target virtual object, wherein one image can be rendered for one target virtual object.
[0042] In one optional implementation of the present disclosure, the target virtual object may include at least one of the following: a virtual model, a shadow of the virtual model.
[0043] In one optional implementation of the present disclosure, in order to achieve the desired rendering effect, the rendering of the target virtual object needs to be based on certain rendering parameters. Accordingly, this step S102 may specifically include the following steps S1021 to S1023.
[0044] Step S1021: providing rendering configuration items for a three-dimensional virtual scene.
[0045] In this step, illustratively, rendering configuration items for the three-dimensional virtual scene may be provided in the DCC toolset, and the rendering configuration items may be displayed in a rendering configuration interface. Optionally, the display of the rendering configuration interface may be triggered by a user operation, such as a user's touch operation in the application interface of the DCC toolset, a user's shortcut key operation, etc. The rendering configuration interface may include rendering configuration items for the three-dimensional virtual scene, and the configuration parameters of the rendering configuration items may determine the rendering effect of the three-dimensional virtual scene.
[0046] Figure 2 An exemplary rendering configuration interface is provided. Figure 2 The contents of the rendering configuration interface shown in the figure are explained.
[0047] Collection Names: Collection names. If you want to render virtual objects in one or more object collections, that is, the target virtual objects to be rendered are virtual objects in one or more object collections, you can fill in / add the collection names of the object collections here. Optionally, you can use a colon (:) to separate different collection names.
[0048] OutputDir: Output directory. You can fill in / add the storage location of the rendered images here.
[0049] The following are the rendering configuration items.
[0050] ModelRender: Model rendering engine. You can select the rendering engine used to render the model. For example, the Cycles renderer can be used to render the model.
[0051] ShadowRender: Shadow rendering engine. You can select the rendering engine used to render the model's shadow. For example, the Cycles renderer can be used to generate the model's shadow.
[0052] Resolution XYAnd Orthographic Scale: Rendering resolution and orthographic scale ratio. For example, ResolutionX (resolution X) can be set to 1600 (pixels), ResolutionY (resolution Y) can be set to 900 (pixels), and OrthographicScale (orthogonal scale ratio) can be set to 45.20, where the orthographic scale ratio also affects the scale ratio of the viewing angle (of the virtual camera set in the 3D virtual scene) to observe the 3D virtual scene.
[0053] Combine Shadow&Model: Merge shadow and model. If this rendering configuration item is selected, the model and shadow will be combined in the final rendered output image.
[0054] Bounding Box Mode (PivotMode by Default): Bounding box mode (the default is center point mode), center point mode is also called pivot point mode.
[0055] Use Full Stage To Receive Shadow (Only Ground by Default): This is a configuration item related to shadow reception, that is, the entire scene receives shadows, and by default only the ground is valid.
[0056] Image Cutter (Delete Empty Area): This is a configuration item related to image cropping, which automatically deletes the blank edge area of the image.
[0057] Pixel Padding (Dilation in Image Cutting): This is a configuration item related to pixel padding based on image cutting, that is, edge dilation processing is performed after image cutting. For example, the value of edge dilation can be 4 pixels.
[0058] ExportJsonFile(For Spine): This is a rendering configuration item related to the rendered output, which can eventually output a text file in a certain format. For example, in Figure 2 In the example of the rendering configuration item provided, the rendering configuration item can be used for a Json format text file (hereinafter referred to as Json text file) that can be applied in Spine.
[0059] Next is the rendering related prompt information, including:
[0060] Normalize Positions (ProcessAll Objects In Collections): This information is used to prompt that the position information of virtual objects in all object collections filled in / added will be normalized.
[0061] Batch Render (BACKUP FIRST! May Edit Mats!!!): This message is a batch rendering warning, prompting the user to back up before execution, because the material settings may be modified after execution.
[0062] Step S1022: In response to the configuration instruction for the rendering configuration item, determine the configuration parameters of the rendering configuration item.
[0063] Optionally, the configuration instructions for the rendering configuration items may be triggered by user operations. For example, the following rendering configuration items may provide configuration parameters to the rendering configuration interface through operations such as drop-down menu selection, checking, and filling performed by the user.
[0064] Step S1023: Rendering the target virtual object according to the configuration parameters of the rendering configuration item to obtain an image containing the target virtual object.
[0065] In this step, the target virtual object in the three-dimensional virtual scene may be rendered according to the current configuration parameters of the rendering configuration item, thereby obtaining an image containing the target virtual object, wherein the image has blank edges.
[0066] In one optional embodiment of the present disclosure, the text file of the information processing method provided by the present disclosure can be used to generate a three-dimensional virtual resource (i.e., a three-dimensional virtual scene in the present disclosure) corresponding to a two-dimensional virtual resource, that is, for a target virtual object in a three-dimensional virtual scene, a text file that can be used for a 2D project is generated. Accordingly, the rendering of the target virtual object can be achieved through the following steps S1024 to S1027.
[0067] Step S1024: Perform orthogonal projection on the bounding box of the target virtual object.
[0068] Projection is the operation of projecting an object in space onto a plane, thus converting a 3D object into a 2D plane image. Projection methods include orthogonal projection and perspective projection. Perspective projection can produce an effect where objects appear larger when near and smaller when far, similar to the way humans observe the world. Orthogonal projection is a parallel projection, similar to using a beam of parallel light to project the image of an object vertically onto a plane, that is, the projection line is perpendicular to the projection plane. In this embodiment, a three-dimensional target virtual object can be projected onto a two-dimensional plane by means of orthogonal projection, thereby realizing the conversion of the target virtual object from a three-dimensional model to a two-dimensional image.
[0069] In this embodiment, in order to save the amount of calculation, the bounding box of the three-dimensional target virtual object can be projected onto a two-dimensional plane by orthogonal projection. Among them, the bounding box algorithm is an algorithm for solving the optimal bounding space of a discrete point set. Its basic idea is to use a geometric body (called a bounding box) with a slightly larger volume and simpler characteristics to approximately replace complex geometric objects. Common bounding box algorithms include AABB bounding box (Axis-alignedbounding box), bounding sphere (Sphere), oriented bounding box OBB (Oriented bounding box) and fixed direction convex hull FDH (Fixed directions hulls or k-DOP). The bounding box algorithm is one of the important methods for collision detection.
[0070] The bounding box can represent the approximate geometric range of the target virtual object, which can save the amount of calculation when performing geometry-related calculations on the target virtual object.
[0071] In an optional implementation, when the target virtual object is a virtual model, the bounding box of the target virtual object may be determined using the above-mentioned common bounding box algorithm.
[0072] In an optional embodiment, when the target virtual object is the shadow of a virtual model, the bounding box of the target virtual object can be determined in the following manner: assume that multiple rays take the light source set in the three-dimensional virtual scene as the origin, pass through each vertex of the bounding box of the virtual model X respectively, and determine the intersection points of the multiple rays with other objects in the scene respectively. The geometric body formed by the intersection points is the bounding box of the shadow of the virtual model X.
[0073] Step S1025: Determine the orthogonal projection size of the bounding box of the target virtual object.
[0074] The orthogonal projection size of the bounding box of the target virtual object includes the width and height of the orthogonal projection of the bounding box of the target virtual object.
[0075] Step S1026: Determine the rendering resolution for the target virtual object according to the orthogonal projection size of the bounding box of the target virtual object.
[0076] In an optional implementation, this step can be specifically implemented in the following manner, including:
[0077] Perform orthogonal projection on the three-dimensional virtual scene;
[0078] Determine the orthogonal projection size of the three-dimensional virtual scene;
[0079] The rendering resolution for the target virtual object is determined according to the orthogonal projection size of the three-dimensional virtual scene, the overall rendering resolution of the three-dimensional virtual scene, and the orthogonal projection size of the bounding box of the target virtual object.
[0080] The three-dimensional virtual scene is also orthogonally projected, and then the orthogonal projection size of the three-dimensional virtual scene is determined, wherein the orthogonal projection size of the three-dimensional virtual scene includes the width and height of the orthogonal projection of the three-dimensional virtual scene. Afterwards, the rendering resolution for the target virtual object can be determined according to the orthogonal projection size of the three-dimensional virtual scene and the overall rendering resolution, as well as the orthogonal projection size of the bounding box of the target virtual object.
[0081] Optionally, the rendering resolution (R) for the target virtual object may be determined according to the following formula: W ,R H );
[0082]
[0083] Among them, (r1, r2) represents the overall rendering resolution of the three-dimensional virtual scene, (a1, a2) represents the orthogonal projection width and orthogonal projection height of the three-dimensional virtual scene, and (b1, b2) represents the orthogonal projection width and orthogonal projection height of the bounding box of the target virtual object.
[0084] Step S1027: Render the target virtual object according to the rendering resolution for the target virtual object to obtain an image including the target virtual object.
[0085] In this step, the rendering resolution (R W ,R H ), render the target virtual object, so as to obtain an image that contains the target virtual object and satisfies the aspect ratio of the three-dimensional virtual scene under the orthogonal camera perspective.
[0086] Step S103: Determine first image information representing the position and size of the target virtual object in the image.
[0087] In this step, first image information representing the position and size of the target virtual object in the image may be determined based on the detection of the image.
[0088] In one optional implementation of the present disclosure, this step can be specifically implemented through the following steps S1031 to S1034.
[0089] Step S1031: Detect the pixel values of the image row by row or column by column.
[0090] In one implementation of this step, the pixel values of the image can be detected row by row starting from the pixel located at the lower left corner of the image, and the pixel values of the image can be detected row by row starting from the pixel located at the upper right corner of the image, or the pixel values of the image can be detected column by column starting from the pixel located at the lower left corner of the image, and the pixel values of the image can be detected column by column starting from the pixel located at the upper right corner of the image, or the pixel values of the image can be detected row by row starting from the pixel located at the upper left corner of the image, and the pixel values of the image can be detected row by row starting from the pixel located at the lower right corner of the image, or the pixel values of the image can be detected column by column starting from the pixel located at the upper left corner of the image, and the pixel values of the image can be detected column by column starting from the pixel located at the lower right corner of the image.
[0091] Figure 3 A schematic diagram of detecting the pixel value of the image is shown as an example. Figure 3In the exemplary embodiment provided, the pixel values of the image can be detected row by row starting from the pixel located at the lower left corner of the image, and the pixel values of the image can be detected row by row starting from the pixel located at the upper right corner of the image. Exemplarily, the pixel values can be RGB values.
[0092] A coordinate system can be constructed for the image, where each pixel of the image corresponds to a pixel coordinate. For example, Figure 3 As shown, the coordinate system may be an XY two-dimensional coordinate system. The lower left corner of the image may be located at the origin of the XY two-dimensional coordinate system. Each pixel point of the image may correspond to a pixel coordinate in the XY two-dimensional coordinate system.
[0093] Step S1032: If the pixel value detected is greater than the preset pixel value for a consecutive preset number of times, determine the pixel coordinates of the image detected when the pixel value is detected to be greater than the preset pixel value for the first time among the consecutive preset number of times.
[0094] In this step, exemplarily, in the process of detecting pixel values starting from the pixel point located at the lower left corner of the image, if the pixel value detected is greater than a threshold value (i.e., a preset pixel value) for multiple consecutive times, the first pixel coordinate corresponding to the first time the pixel value is detected to be greater than the threshold value in the multiple consecutive times is determined.
[0095] based on Figure 3 In the exemplary embodiment provided, the pixel values of the image can be detected row by row starting from the coordinates x, y = 0 (i.e., the lower left corner of the image), and i = 0 is set, where i is used to represent the number of consecutive times that the pixel value is detected to be greater than the threshold. If the pixel value of the current coordinate is less than or equal to the threshold, i remains unchanged, and if the pixel value of the current coordinate is greater than the threshold, i is increased by 1. If the pixel value of the current coordinate is less than or equal to the threshold, the pixel value of the next coordinate is detected, and the x coordinate value is increased by 1 after each detection of the pixel value of a coordinate of the current row, and the pixel value of the next coordinate of the current row is detected. If the pixel values of all coordinates of the current row are detected, the x coordinate value is returned to 0, the y coordinate value is increased by 1, and the pixel values of the coordinates of the next row are detected. If the pixel value of the current coordinate is greater than the threshold, i is increased by 1, and if the pixel value of the next adjacent coordinate is less than or equal to the threshold, i is returned to 0. Exemplarily, if the pixel value is greater than the threshold for three consecutive times, that is, i is greater than 2, the first pixel coordinate corresponding to the first time the pixel value is detected to be greater than the threshold in the three consecutive times is retained.
[0096] In this step, in the process of detecting pixel values starting from the pixel point located at the upper right corner of the image, if the pixel value is detected to be greater than the threshold value for multiple consecutive times, the second pixel coordinate corresponding to the first time the pixel value is detected to be greater than the threshold value in the multiple consecutive times is determined.
[0097] based on Figure 3 The exemplary embodiment provided can be represented by coordinates x, y = xm ,y m (i.e. the upper right corner of the image) starts to detect the pixel values of the image row by row, and set j = 0, where j is used to represent the number of consecutive times that the pixel value is greater than the threshold. If the pixel value of the current coordinate is less than or equal to the threshold, j remains unchanged. If the pixel value of the current coordinate is greater than the threshold, j increases by 1. If the pixel value of the current coordinate is less than or equal to the threshold, continue to detect the pixel value of the next coordinate. After each pixel value of a coordinate in the current row is detected, the x coordinate value decreases by 1, and the pixel value of the next coordinate in the current row is detected. If the pixel values of all coordinates in the current row are detected, the x coordinate value returns to x. m , the y coordinate value is reduced by 1, and the pixel value of the coordinate of the next row is detected. If the pixel value of the current coordinate is greater than the threshold, j is increased by 1. If the pixel value of the next adjacent coordinate is less than or equal to the threshold, j is returned to 0. For example, if the pixel value is greater than the threshold for three consecutive times, that is, j is greater than 2, the second pixel coordinate corresponding to the first time the pixel value is greater than the threshold is retained.
[0098] In the present disclosure, the detection is stopped only when the value is greater than the threshold value for multiple consecutive times, so as to avoid the situation where a large blank space remains in the subsequently cropped image due to rendering noise.
[0099] Step S1033: determining the position coordinates of the target virtual object in the image and the size of the sub-image containing the target virtual object according to the pixel coordinates.
[0100] In this step, assuming that the first pixel coordinates are (x1, y1) and the second pixel coordinates are (x2, y2), a rectangle Rec can be determined with the line between the first pixel coordinates and the second pixel coordinates as the diagonal line. The center point coordinates (x c ,y c ) is: x c =(x1+x2) / 2,y c =(y1+y2) / 2, the size (w,h) of the rectangle Rec is: w=│x2-x1│, h=│y2-y1│, where w is the width of the rectangle Rec and h is the height of the rectangle Rec.
[0101] Among them, the center point coordinates of the rectangle Rec (x c ,y c) are the position coordinates of the target virtual object in the image including the target virtual object, and the size of the rectangle Rec is the size of the sub-image including the target virtual object, wherein the width w of the rectangle Rec can represent the width of the target virtual object in the image including the target virtual object, and the height h of the rectangle Rec can represent the height of the target virtual object in the image including the target virtual object. Therefore, the width of the sub-image including the target virtual object is the width of the target virtual object in the image including the target virtual object, and the height of the sub-image including the target virtual object is the height of the target virtual object in the image including the target virtual object.
[0102] Optionally, the center point coordinates (x c ,y c ) and the size (w, h) of the rectangle Rec are saved in a first text file, for example, in a first txt text file, such as Figure 4 shown.
[0103] Optionally, the first image information may further include the first pixel coordinates (x1, y1) and the second pixel coordinates (x2, y2), and the first pixel coordinates (x1, y1) and the second pixel coordinates (x2, y2) may also be saved to the first text file, such as Figure 4 shown.
[0104] In one optional embodiment of the present disclosure, the information processing method may further include the following steps: determining the second image information, wherein the second image information includes a size ratio, and the size ratio is the width w of the image (i.e., the image containing the target virtual object) x The ratio of the width resolution r1 in the overall rendering resolution of the 3D virtual scene, or the height h of the image (i.e., the image containing the target virtual object) x The ratio of the height resolution r2 in the overall rendering resolution of the 3D virtual scene.
[0105] For an image containing a target virtual object, second image information may be determined, the second image information including a size ratio Ratio, where Ratio=w x / r1=h x / r2.
[0106] The second image information can be used to compress the texture of the target virtual object for performance optimization. Accordingly, the information processing method can also include the following steps: in response to a compression instruction for the texture of the target virtual object, compressing the texture of the target virtual object according to the size ratio Ratio.
[0107] Optionally, the size ratio Ratio can be saved in a second text file, such as a second txt text file, such as Figure 5 shown.
[0108] The first image information and the second image information are respectively saved in different text files, which can be easily read according to needs.
[0109] Step S104: Crop the blank edge of the image according to the first image information to obtain a sub-image containing the target virtual object.
[0110] In this step, the blank area at the edge of the image containing the target virtual object may be cropped according to the first image information to maximize the size utilization of the image.
[0111] In one of the optional embodiments of the present disclosure, this step can be specifically implemented in the following manner: based on the position coordinates of the target virtual object in the image (i.e., the image containing the target virtual object) and the size of the sub-image containing the target virtual object, a sub-image containing the target virtual object is cropped from the image.
[0112] For example, according to the center coordinates (x c ,y c ) and size (w, h), cropping the image portion except the rectangle Rec in the image containing the target virtual object (that is, only retaining the portion of the rectangle Rec in the image), thereby obtaining a sub-image including the target virtual object, wherein the edge of the sub-image is circumscribed to the target virtual object.
[0113] It should be noted that if the Image Cutter (Delete Empty Area) configuration item in the rendering configuration item is selected, this step can be performed to crop the blank edges of the image containing the target virtual object, thereby obtaining a sub-image whose image edge is circumscribed to the target virtual object. If the Pixel Padding (Dilation in Image Cutting) configuration item in the rendering configuration item is selected, the edge of the cropped sub-image will be expanded, that is, the edges of N pixels in width will be filled in the four directions of the top, bottom, left and right of the cropped sub-image. Exemplarily, N can be 4. Exemplarily, N can be 5. Exemplarily, N can be 3, and so on.
[0114] In one embodiment, a sub-image including a target virtual object, a first text file for storing first image information, and a second text file for storing second image information can be obtained. Figure 6As shown, sub-images of four virtual models and their corresponding first text files and second text files, as well as sub-images of the shadows of the four virtual models and their corresponding first text files and second text files can be obtained.
[0115] Step S105: Generate a text file according to the sub-image and the first image information.
[0116] In one of the optional embodiments of the present disclosure, this step can be specifically implemented in the following manner, including: generating a first text content representing the skeletal attachment relationship of the target virtual object based on a sub-image containing the target virtual object, and generating a second text content representing the position and size of the target virtual object in the image containing the target virtual object based on the first image information, so as to obtain the text file.
[0117] Alternatively, in some DCC toolsets, models can be animated based on a skeletal animation framework, where a model has a skeleton structure consisting of interconnected "bones" that are animated by changing the orientation and position of the bones. For example, in Spine, images of a model can be bound to bones, and then 2D animations can be created using the bones.
[0118] Taking the example of generating a Json text file that can be used in Spine based on the sub-image and the first image information, the Json text file can include the following content:
[0119] Bones: Bones are the basic structure of animation. Each bone has its own position, rotation, scale and parent-child relationship, so animation effects can be achieved by controlling these properties of bones. There is a parent-child relationship between bones. Changes to the parent bone will be transmitted to the child bone, that is, the parent bone can affect the change of the child bone. In the Bones section, you can record bone information, such as the name of the bone, the name of the parent bone of the bone, the rotation, position, scale, length of the bone in the parent bone, how to inherit the changes of the parent bone, the color of the bone, etc.
[0120] Slots: Slots are the level under bones. A bone can contain multiple slots, which means we can switch slots (for example, changing weapons in a game). Slots can control some rendering properties of attachments, such as color, blending, alpha value, etc., which will affect the rendering effect of attachments. In the Slots section, you can record the slot name, attached bone name, attachment name, etc.
[0121] Skins: Setting Skins allows bones on a skeleton to use different attachments. Multiple similar skeletons can be reused by replacing attachments. The available attachments, i.e. the skin information of the skeleton, can be recorded in the Skins section.
[0122] Exemplarily, the first text content, i.e., the content of the Slots part, for characterizing the bone attachment relationship of the target virtual object can be generated according to the sub-image containing the target virtual object in the Json format that can be imported into Spine. Among them, the name of the slot name part of the Slots part can be filled with the name of the sub-image A-1 containing the target virtual object A, the name of the bone to which the target virtual object A is attached (such as the root bone root) can be filled in the attached bone name bone part of the Slots part, and the name of the sub-image A-1 containing the target virtual object A can be filled in the attachment attachment part of the Slots part. The same applies to the sub-image B-1 containing the target virtual object B, the sub-image C-1 containing the target virtual object C, and so on.
[0123] The generation result of the first text content can be expressed as:
[0124] "slots":[
[0125] {"name":"A-1","bone":"root","attachment":"A-1"},
[0126] {"name":"B-1","bone":"root","attachment":"B-1"},
[0127] {"name":"C-1","bone":"root","attachment":"C-1"}, ]
[0129] For example, the second text content for representing the position and size of the target virtual object in the image containing the target virtual object can be generated according to the first image information in the Json format that can be imported into Spine, that is, the content of the Skins part. The center point coordinates (x c1 ,y c1 ), (x c1 ,y c1) can represent the position of the target virtual object A in the image containing the target virtual object, and the width of the attachment A-1 in the Skins section is filled with the width w1 of the attachment A-1, and the height of the attachment A-1 in the Skins section is filled with the width h1 of the attachment A-1, and (w1,h1) can represent the size of the target virtual object A in the image containing the target virtual object. The same is true for attachment B-1, attachment C-1, etc.
[0130] The generation result of the second text content can be expressed as:
[0131] "skins":{
[0132] "default":{
[0133] "A-1":{"A-1":{"x":x c1 ,“y”:y c1 ,"width":w1,"height":h1}},
[0134] "B-1":{"B-1":{"x":x c2 ,“y”:y c2 ,"width":w2,"height":h2}},
[0135] "C-1":{"C-1":{"x":x c3 ,“y”:y c3 ,"width":w3,"height":h3}},
[0136] }
[0137] In this way, a Json text file that can be imported into Spine can be generated, that is, a text file that can be used to generate a two-dimensional virtual resource corresponding to the target virtual object in Spine is generated, such as Figure 6 shown.
[0138] In one optional implementation of the present disclosure, the information processing method may further include the following steps:
[0139] In response to a read instruction for the text file, read a first text content in the text file to obtain a skeletal attachment relationship of a target virtual object and read a second text content in the text file to obtain a position and a size of the target virtual object in an image containing the target virtual object;
[0140] The target virtual object is displayed according to the skeleton attachment relationship of the target virtual object and the position and size of the target virtual object in the image containing the target virtual object.
[0141] In this embodiment, a user can create a three-dimensional virtual object in one DCC toolset and generate a text file that can be imported into another DCC toolset. The text file is used to generate a two-dimensional virtual resource corresponding to the three-dimensional virtual object in another DCC toolset. The user can import the generated text file into another DCC toolset through an import operation, thereby triggering a read instruction for the text file of another DCC toolset. In response to the read instruction for the text file, another DCC toolset can read the content in the text file to obtain the skeletal attachment relationship of the target virtual object and the position and size of the target virtual object in the image containing the target virtual object recorded in the text file, and then display the target virtual object in a graphical user interface provided by another DCC toolset based on the above-mentioned content read. If there are multiple target virtual objects, the stitching results of the sub-images of the multiple target virtual objects can be displayed, such as Figure 7 , that is Figure 6 The stitching result of the sub-images of the four virtual models and their respective shadows is shown. In this way, a text file that can be imported into another DCC tool set can be generated based on the 3D virtual resource produced in one DCC tool set, and then the 2D virtual resource corresponding to the 3D virtual resource can be generated in another DCC tool set based on the text file.
[0142] The information processing method provided by the present disclosure first obtains the target virtual object to be rendered in the three-dimensional virtual scene; then renders the target virtual object to obtain an image containing the target virtual object; then determines the first image information representing the position and size of the target virtual object in the image; cuts the blank edge of the image according to the first image information to obtain a sub-image containing the target virtual object; and then generates a text file according to the sub-image and the first image information. In the present disclosure, the three-dimensional virtual resource in the three-dimensional virtual scene can be rendered to obtain an image containing the three-dimensional virtual resource, and the image information about the position and size of the three-dimensional virtual resource can be recorded, and then a text file can be generated containing the image of the three-dimensional virtual resource and the recorded image information, and the text file can be used to generate the two-dimensional virtual resource corresponding to the three-dimensional virtual resource. The above process does not need to be implemented across applications, which reduces the complexity of generating text files and improves the efficiency of generating text files.
[0143] In the prior art, the process of generating text files that can be used for 2D projects needs to be implemented across applications, and the process is highly complex; manual split rendering requires a lot of manpower, low processing efficiency, and manual switching / hiding of rendering targets is prone to errors. The larger the scene, the more manual operations are performed, and the problems of low processing efficiency and easy errors will become more prominent; virtual objects of different sizes in the scene are rendered at the same resolution, resulting in a waste of computing power; only one standard result can be output each time, and the cost doubles when multiple specifications are output, and the versatility is low.
[0144] In the exemplary embodiments provided by the present disclosure, text files that can be used for 2D projects can be generated in one DCC toolset without cross-application, reducing the complexity of the process; layers can be automatically split, and virtual objects in an object collection can be selected as rendering targets. In this way, text files that can be used for 2D projects can be automatically generated in batches for rendering targets, improving processing efficiency and reducing the probability of errors; virtual objects of different sizes in the scene can be rendered at a resolution that suits them, reducing the waste of computing power; by adjusting the configuration parameters of the rendering configuration items, resources of different specifications can be output, improving versatility.
[0145] Corresponding to the information processing method provided by the embodiment of the present disclosure, the embodiment of the present disclosure also provides an information processing device. Figure 8 As shown, the device 700 includes:
[0146] An object acquisition module 701 is used to acquire a target virtual object to be rendered, wherein the target virtual object is a virtual object included in a three-dimensional virtual scene;
[0147] An object rendering module 702 is used to render the target virtual object to obtain an image containing the target virtual object;
[0148] An information determination module 703 is used to determine first image information representing the position and size of the target virtual object in the image;
[0149] An image cropping module 704 is configured to crop the blank edge of the image according to the first image information to obtain a sub-image containing the target virtual object;
[0150] The file generating module 705 is used to generate a text file according to the sub-image and the first image information.
[0151] Optionally, rendering the target virtual object to obtain an image including the target virtual object includes:
[0152] Setting display parameters of a target virtual object to be rendered in the three-dimensional virtual scene to be visible, setting display parameters of virtual objects other than the target virtual object in the three-dimensional virtual scene to be invisible, and retaining the lighting in the three-dimensional virtual scene;
[0153] The target virtual object with display parameters set to be visible is rendered to obtain an image containing the target virtual object.
[0154] Optionally, rendering the target virtual object to obtain an image including the target virtual object includes:
[0155] Performing orthogonal projection on the bounding box of the target virtual object;
[0156] Determining the orthogonal projection size of the bounding box of the target virtual object;
[0157] Determining a rendering resolution for the target virtual object according to an orthogonal projection size of a bounding box of the target virtual object;
[0158] The target virtual object is rendered according to a rendering resolution for the target virtual object to obtain an image including the target virtual object.
[0159] Optionally, determining the rendering resolution for the target virtual object according to the orthogonal projection size of the bounding box of the target virtual object includes:
[0160] Performing orthogonal projection on the three-dimensional virtual scene;
[0161] Determining the orthogonal projection size of the three-dimensional virtual scene;
[0162] The rendering resolution for the target virtual object is determined according to the orthogonal projection size of the three-dimensional virtual scene, the overall rendering resolution of the three-dimensional virtual scene, and the orthogonal projection size of the bounding box of the target virtual object.
[0163] Optionally, determining the rendering resolution for the target virtual object according to the orthogonal projection size of the three-dimensional virtual scene, the overall rendering resolution of the three-dimensional virtual scene, and the orthogonal projection size of the bounding box of the target virtual object includes:
[0164] The rendering resolution (R) for the target virtual object is determined according to the following formula: W ,R H );
[0165]
[0166]
[0167] Among them, (r1, r2) represents the overall rendering resolution of the three-dimensional virtual scene, (a1, a2) represents the orthogonal projection width and orthogonal projection height of the three-dimensional virtual scene, and (b1, b2) represents the orthogonal projection width and orthogonal projection height of the bounding box of the target virtual object.
[0168] Optionally, generating a text file according to the sub-image and the first image information includes:
[0169] A first text content representing the skeletal attachment relationship of the target virtual object is generated according to the sub-image, and a second text content representing the position and size of the target virtual object in the image is generated according to the first image information to obtain a text file.
[0170] Optionally, the device is also used for:
[0171] In response to a read instruction for the text file, read a first text content in the text file to obtain a skeletal attachment relationship of the target virtual object and read a second text content in the text file to obtain a position and a size of the target virtual object in the image;
[0172] The target virtual object is displayed according to the skeleton attachment relationship of the target virtual object and the position and size of the target virtual object in the image.
[0173] Optionally, the determining the first image information representing the position and size of the target virtual object in the image includes:
[0174] Detecting pixel values of the image row by row or column by column;
[0175] If the pixel value is detected to be greater than the preset pixel value for a consecutive preset number of times, determining the pixel coordinates of the image detected when the pixel value is detected to be greater than the preset pixel value for the first time among the consecutive preset number of times;
[0176] The position coordinates of the target virtual object in the image and the size of the sub-image containing the target virtual object are determined according to the pixel coordinates.
[0177] Optionally, the step of cropping the blank edge of the image according to the first image information to obtain a sub-image containing the target virtual object includes:
[0178] The sub-image is obtained by cutting out the image according to the position coordinates of the target virtual object in the image and the size of the sub-image containing the target virtual object.
[0179] Optionally, rendering the target virtual object to obtain an image including the target virtual object includes:
[0180] Providing rendering configuration items for the three-dimensional virtual scene;
[0181] In response to a configuration instruction for the rendering configuration item, determining a configuration parameter of the rendering configuration item;
[0182] The target virtual object is rendered according to the configuration parameters of the rendering configuration item to obtain an image containing the target virtual object.
[0183] Optionally, the device is also used for:
[0184] Determine second image information, wherein the second image information includes a size ratio, wherein the size ratio is a ratio of a width of the image to a width resolution in an overall rendering resolution of the three-dimensional virtual scene, or a ratio of a height of the image to a height resolution in an overall rendering resolution of the three-dimensional virtual scene.
[0185] Optionally, the device is also used for:
[0186] In response to a compression instruction for the texture of the target virtual object, the texture of the target virtual object is compressed according to the size ratio.
[0187] Optionally, the target virtual object includes at least one of the following: a virtual model, a shadow of a virtual model.
[0188] The information processing device provided by the present disclosure first obtains the target virtual object to be rendered in the three-dimensional virtual scene; then renders the target virtual object to obtain an image containing the target virtual object; then determines the first image information representing the position and size of the target virtual object in the image; cuts the blank edge of the image according to the first image information to obtain a sub-image containing the target virtual object; and then generates a text file according to the sub-image and the first image information. In the present disclosure, the three-dimensional virtual resource in the three-dimensional virtual scene can be rendered to obtain an image containing the three-dimensional virtual resource, and the image information about the position and size of the three-dimensional virtual resource can be recorded, and then a text file can be generated containing the image of the three-dimensional virtual resource and the recorded image information, and the text file can be used to generate the two-dimensional virtual resource corresponding to the three-dimensional virtual resource. The above process does not need to be implemented across applications, which reduces the complexity of generating text files and improves the efficiency of generating text files.
[0189] Next, an electronic device provided by an embodiment of the present disclosure is introduced. Fig. 9 , Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. The electronic device 800 may be equipped with the information processing device described in the embodiment of the present disclosure to implement the functions in the embodiment of the present disclosure. Specifically, the electronic device 800 includes: a receiver 801, a transmitter 802, a processor 803, and a memory 804 (the number of processors 803 in the electronic device 800 may be one or more, Fig. 9 In the example of FIG. 801 , the processor 803 may include an application processor 8031 and a communication processor 8032. In some embodiments of the present disclosure, the receiver 801, the transmitter 802, the processor 803 and the memory 804 may be connected via a bus or other means.
[0190] The memory 804 may include a read-only memory and a random access memory, and provides instructions and data to the processor 803. A portion of the memory 804 may also include a non-volatile random access memory (NVRAM). The memory 804 stores processor and operation instructions, executable modules or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.
[0191] The processor 803 controls the operation of the execution device. In a specific application, the various components of the execution device are coupled together through a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, various buses are referred to as bus systems in the figure.
[0192] The method disclosed in the above embodiment of the present disclosure can be applied to the processor 803, or implemented by the processor 803. The processor 803 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 803. The above processor 803 can be a general processor, a digital signal processor (digital signal processing, DSP), a microprocessor or a microcontroller, and can further include an application specific integrated circuit (application specific integrated circuit, ASIC), a field programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The processor 803 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiment of the present disclosure. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiment of the present disclosure can be directly embodied as a hardware decoding processor to be executed, or a combination of hardware and software modules in the decoding processor can be executed. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 804, and the processor 803 reads the information in the memory 804 and completes the steps of the above method in combination with its hardware.
[0193] The receiver 801 can be used to receive input digital or character information and generate signal input related to the relevant settings and function control of the execution device. The transmitter 802 can be used to output digital or character information through the first interface; the transmitter 802 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; the transmitter 802 can also include a display device such as a display screen.
[0194] In the embodiment of the present disclosure, the application processor 8031 in the processor 803 is used to execute the information processing method in the embodiment of the present disclosure. It should be noted that the specific manner in which the application processor 8031 executes each step is based on the same concept as the various method embodiments in the present disclosure, and the technical effects brought by it are the same as the various method embodiments in the present disclosure. For specific contents, please refer to the description in the method embodiments shown in the above disclosure, and no further description will be given here.
[0195] The disclosed embodiment also provides a chip for executing instructions, which is used to execute the technical solution of the information processing method in the above embodiment.
[0196] The embodiment of the present disclosure further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a processor, the processor executes the technical solution of the information processing method in the above embodiment.
[0197] The embodiments of the present disclosure further provide a computer program product, including a computer program, which is used to execute the technical solution of the information processing method in the above embodiments when executed by a processor.
[0198] The computer readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or dedicated server.
[0199] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
[0200] Although the present disclosure is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present disclosure. Any person skilled in the art may make possible changes and modifications without departing from the spirit and scope of the present disclosure. Therefore, the scope of protection of the present disclosure shall be based on the scope defined by the claims of the present disclosure.
Claims
1. An information processing method, characterized in that: The method comprises: Acquire a target virtual object to be rendered, wherein the target virtual object is a virtual object included in a three-dimensional virtual scene; Rendering the target virtual object to obtain an image containing the target virtual object; Determine first image information representing the position and size of the target virtual object in the image; Cutting the blank edge of the image according to the first image information to obtain a sub-image containing the target virtual object; A text file is generated according to the sub-image and the first image information.
2. The method according to claim 1, characterized in that The step of rendering the target virtual object to obtain an image including the target virtual object includes: Setting display parameters of a target virtual object to be rendered in the three-dimensional virtual scene to be visible, setting display parameters of virtual objects other than the target virtual object in the three-dimensional virtual scene to be invisible, and retaining the lighting in the three-dimensional virtual scene; The target virtual object with display parameters set to be visible is rendered to obtain an image containing the target virtual object.
3. The method according to claim 1, characterized in that: The step of rendering the target virtual object to obtain an image including the target virtual object includes: Performing orthogonal projection on the bounding box of the target virtual object; Determining the orthogonal projection size of the bounding box of the target virtual object; Determining a rendering resolution for the target virtual object according to an orthogonal projection size of a bounding box of the target virtual object; The target virtual object is rendered according to a rendering resolution for the target virtual object to obtain an image including the target virtual object.
4. The method according to claim 3, characterized in that The determining, according to the orthogonal projection size of the bounding box of the target virtual object, a rendering resolution for the target virtual object comprises: Performing orthogonal projection on the three-dimensional virtual scene; Determining the orthogonal projection size of the three-dimensional virtual scene; The rendering resolution for the target virtual object is determined according to the orthogonal projection size of the three-dimensional virtual scene, the overall rendering resolution of the three-dimensional virtual scene, and the orthogonal projection size of the bounding box of the target virtual object.
5. The method according to claim 4, characterized in that The determining the rendering resolution for the target virtual object according to the orthogonal projection size of the three-dimensional virtual scene, the overall rendering resolution of the three-dimensional virtual scene, and the orthogonal projection size of the bounding box of the target virtual object comprises: The rendering resolution (R) for the target virtual object is determined according to the following formula: W ,R H ); Among them, (r1, r2) represents the overall rendering resolution of the three-dimensional virtual scene, (a1, a2) represents the orthogonal projection width and orthogonal projection height of the three-dimensional virtual scene, and (b1, b2) represents the orthogonal projection width and orthogonal projection height of the bounding box of the target virtual object.
6. The method according to claim 1, characterized in that The step of generating a text file according to the sub-image and the first image information includes: A first text content representing the skeletal attachment relationship of the target virtual object is generated according to the sub-image, and a second text content representing the position and size of the target virtual object in the image is generated according to the first image information to obtain a text file.
7. The method according to claim 6, characterized in that The method further comprises: In response to a read instruction for the text file, read a first text content in the text file to obtain a skeletal attachment relationship of the target virtual object and read a second text content in the text file to obtain a position and a size of the target virtual object in the image; The target virtual object is displayed according to the skeleton attachment relationship of the target virtual object and the position and size of the target virtual object in the image.
8. The method according to claim 1, characterized in that The determining of first image information representing the position and size of the target virtual object in the image includes: Detecting pixel values of the image row by row or column by column; If the pixel value is detected to be greater than the preset pixel value for a consecutive preset number of times, determining the pixel coordinates of the image detected when the pixel value is detected to be greater than the preset pixel value for the first time among the consecutive preset number of times; The position coordinates of the target virtual object in the image and the size of the sub-image containing the target virtual object are determined according to the pixel coordinates.
9. The method according to claim 8, characterized in that The step of cutting the blank edge of the image according to the first image information to obtain a sub-image containing the target virtual object includes: The sub-image is obtained by cutting out the image according to the position coordinates of the target virtual object in the image and the size of the sub-image containing the target virtual object.
10. The method according to claim 1, characterized in that The step of rendering the target virtual object to obtain an image including the target virtual object includes: Providing rendering configuration items for the three-dimensional virtual scene; In response to a configuration instruction for the rendering configuration item, determining a configuration parameter of the rendering configuration item; The target virtual object is rendered according to the configuration parameters of the rendering configuration item to obtain an image containing the target virtual object.
11. The method according to claim 1, characterized in that: The method further comprises: Determine second image information, wherein the second image information includes a size ratio, wherein the size ratio is a ratio of a width of the image to a width resolution in an overall rendering resolution of the three-dimensional virtual scene, or a ratio of a height of the image to a height resolution in an overall rendering resolution of the three-dimensional virtual scene.
12. The method according to claim 11, characterized in that The method further comprises: In response to a compression instruction for the texture of the target virtual object, the texture of the target virtual object is compressed according to the size ratio.
13. The method according to claim 1, characterized in that The target virtual object includes at least one of the following: a virtual model, and a shadow of a virtual model.
14. An information processing device, characterized in that: The device comprises: An object acquisition module, used to acquire a target virtual object to be rendered, wherein the target virtual object is a virtual object included in a three-dimensional virtual scene; An object rendering module, used for rendering the target virtual object to obtain an image containing the target virtual object; An information determination module, used to determine first image information representing the position and size of the target virtual object in the image; An image cropping module, configured to crop the blank edge of the image according to the first image information to obtain a sub-image containing the target virtual object; The file generation module is used to generate a text file according to the sub-image and the first image information.
15. An electronic device, characterized in that: include: A processor, a memory, and computer program instructions stored on the memory and executable on the processor; When the processor executes the computer program instructions, the information processing method according to any one of claims 1 to 13 is implemented.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, they are used to implement the information processing method as described in any one of claims 1 to 13 above.
