A scene rendering method, device, equipment and readable storage medium

By obtaining and instantiating the root component, generating rendering objects based on component data, and using the scene manager to render the scene, the problems of long development cycles and poor reusability in the existing technology are solved, and the visual development efficiency is improved.

CN113535169BActive Publication Date: 2025-01-10HANGZHOU DBAPPSECURITY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110789026.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-13
Publication Date
2025-01-10
Estimated Expiration
2041-07-13

AI Technical Summary

Technical Problem

In existing visual development, hard coding leads to a long development cycle, large resource usage, poor component reusability, resulting in low development efficiency.

Method used

By obtaining component data and configuration information of the target scene, instantiating the root component, determining the global information of the rendering component based on the component data, and instantiating each component according to the layer structure to generate rendering objects, and using the scene manager to render to realize scene rendering.

Benefits of technology

Improves visual development efficiency, reduces the need for hard-coded components, and enhances component flexibility and reusability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535169B_ABST
    Figure CN113535169B_ABST
Patent Text Reader

Abstract

The present application discloses a scene rendering method, device, equipment and readable storage medium, the method comprising: obtaining component data and component configuration information corresponding to a target scene; instantiating a root component based on the component data and component configuration information; the root component is the top-level parent of all components; using the root component, determining the global information of the rendering component according to the component data; instantiating each component according to the layer structure to generate a rendering object; wherein each rendering object is stored in a scene; the scene manager calls each corresponding scene to render the rendering object, and finally renders the entire target scene. In the present application, the business scene is decoupled from the component, that is, the component is not scenario-encapsulated, and when a scene needs to be rendered, there is no need to hard-code the component, that is, the scene rendering can be gradually realized by combining the root component instantiated based on the component data and component configuration information, which can speed up the visualization development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer visualization technology, and in particular to a scene rendering method, device, equipment and readable storage medium. Background Art

[0002] In the DT (Data Technology) era, data mining, sorting and cleaning, data analysis, and finally decision-making are inseparable from the development of data visualization technology. Various middle-end systems, command screens, and monitoring screens are all using 3D visualization technology. Visualization technology can vividly and realistically express various data so that users can quickly respond and make decisions.

[0003] Different business scenarios and industry backgrounds have different requirements for visualization. If each visualization interface is implemented through hard coding, there will be problems such as long development cycle and large amount of development resources. The general component idea is to encapsulate the development of a certain function or business and reuse it in the same scenario. However, if there is an inconsistency between the current requirements and the encapsulation of the components, the encapsulated components cannot be reused, resulting in poor flexibility and low visualization development efficiency.

[0004] In summary, how to effectively improve the efficiency of visualization development and other issues are technical problems that technical personnel in this field urgently need to solve. Summary of the invention

[0005] The purpose of this application is to provide a scene rendering method, device, equipment and readable storage medium, which can improve the efficiency of visualization development.

[0006] In order to solve the above technical problems, this application provides the following technical solutions:

[0007] A scene rendering method, comprising:

[0008] Obtain component data and component configuration information corresponding to the target scenario;

[0009] Based on the component data and the component configuration information, a root component is instantiated; the root component is the top-level parent of all components;

[0010] Using the root component, determining global information of a rendering component according to the component data;

[0011] Instantiating each of the components according to the layer structure to generate a rendering object; wherein each of the rendering objects is stored in a scene;

[0012] The scene manager calls each corresponding scene to render the rendering object, and finally renders the entire target scene.

[0013] Preferably, instantiating each of the components according to the layer structure to generate a rendering object includes:

[0014] In the process of instantiating each of the components, the geometry, material and rendering object are generated, and the corresponding information is obtained as the final position of the component according to the characteristics of the corresponding parent component; wherein the characteristics of the parent component include the specific shape characteristics of the parent node, and the specific shape characteristics are point-shaped, line-shaped, surface-shaped or body-shaped.

[0015] Preferably, using the root component, determining the global information of the rendering component according to the component data includes:

[0016] Determining whether the normalized data of the root node includes a conversion function;

[0017] If yes, converting the component data into position information of the entire component using the conversion function;

[0018] If not, the default engine's origin position is used as the position information of the entire component.

[0019] Preferably, the scene manager calls each corresponding scene to render the rendering object, and finally renders the entire target scene, including:

[0020] In each frame, the scene manager is called to perform updating, the scene manager updates each of the scenes, and each of the scenes renders each of the corresponding rendering objects.

[0021] Preferably, the obtaining of component data and component configuration information corresponding to the target scene includes:

[0022] Receiving a rendering request for the target scene;

[0023] In combination with the basic component expression structure, the rendering request is parsed to obtain the component data and the component configuration information.

[0024] Preferably, receiving a rendering request for the target scene includes:

[0025] The visual editing interface corresponding to the target scene is monitored to receive the rendering request.

[0026] Preferably, the basic component expression structure includes:

[0027] Basic component name, component structure change parameters, component drawing style parameters, and subcomponents of the current component.

[0028] A scene rendering device, comprising:

[0029] Data acquisition module, used to obtain component data and component configuration information corresponding to the target scene;

[0030] A root component instantiation module, used to instantiate a root component based on the component data and the component configuration information; the root component is the top-level parent of all components;

[0031] A global information determination module, used to determine the global information of the rendering component according to the component data using the root component;

[0032] A component instantiation module, used to instantiate each of the components according to the layer structure to generate a rendering object; wherein each of the rendering objects is stored in a scene;

[0033] The scene rendering module is used for the scene manager to call each corresponding scene to render the rendering object, and finally render the entire target scene.

[0034] An electronic device, comprising:

[0035] Memory for storing computer programs;

[0036] A processor is used to implement the steps of the above-mentioned scene rendering method when executing the computer program.

[0037] A readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned scene rendering method are implemented.

[0038] Apply the method provided in the embodiment of the present application to obtain component data and component configuration information corresponding to the target scene; based on the component data and component configuration information, instantiate a root component; the root component is the top-level parent of all components; use the root component to determine the global information of the rendering component according to the component data; instantiate each component according to the layer structure to generate a rendering object; wherein each rendering object is stored in a scene; the scene manager calls each corresponding scene to render the rendering object, and finally renders the entire target scene.

[0039] In this application, when it is necessary to render the target scene, it is only necessary to obtain the component data and component configuration information corresponding to the target scene, and then instantiate a root component based on the component data and component configuration information. Then, the global information of the rendering component can be determined with the help of the root component. A rendering object can be generated by instantiating each component, and each rendering object is stored in a scene. Therefore, the target scene can be rendered by calling the corresponding rendering object for rendering using the scene manager. In other words, in this application, the business scenario is decoupled from the component, that is, the component is not scenario-encapsulated, and when a scene needs to be rendered, there is no need to hard-code the various components of the current scene, that is, the scene rendering can be gradually realized in combination with the root component instantiated based on the component data and component configuration information, which can speed up the efficiency of visualization development.

[0040] Correspondingly, the embodiments of the present application also provide a scene rendering device, equipment and readable storage medium corresponding to the above-mentioned scene rendering method, which have the above-mentioned technical effects and are not repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0042] Figure 1 This is a flowchart of an implementation method of a scene rendering method in an embodiment of the present application;

[0043] Figure 2 This is a schematic diagram of a combination of an icon component and a text component in an embodiment of the present application;

[0044] Figure 3 This is a schematic diagram of a combination component and a line component in an embodiment of the present application;

[0045] Figure 4 This is a schematic diagram of the component combination effect of a particle component in an embodiment of the present application;

[0046] Figure 5 This is a schematic diagram of the component combination effect of multiple components in an embodiment of the present application;

[0047] Figure 6 This is a schematic diagram of a component rendering process in an embodiment of the present application;

[0048] Figure 7 This is a schematic diagram of the structure of a scene rendering device in an embodiment of the present application;

[0049] Figure 8 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application;

[0050] Fig. 9 This is a schematic diagram of a specific structure of an electronic device in an embodiment of the present application;

[0051] Fig.10 This is a specific schematic diagram of a rendering implementation in an embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0053] Please refer to Figure 1 and Figure 6 , Figure 1 This is a flow chart of a scene rendering method in an embodiment of the present application. Figure 6 A schematic diagram of a component rendering process in an embodiment of the present application.

[0054] The scene rendering method comprises the following steps:

[0055] S101. Obtain component data and component configuration information corresponding to a target scene.

[0056] Among them, the target scene can be a specific business scene that needs to be visualized, the component data can be specifically data indicating the component type, component quantity and location, etc., and the component configuration information is information for configuring the component, such as color, transparency, etc.

[0057] It should be noted that in this embodiment, the component may specifically refer to a three-dimensional component, which can run on the engine. Each component includes data, rendering parameters, component structure parameters, etc. The user only needs to pass the component name, component data and related parameters to the engine to see the response effect on the Web page.

[0058] Specifically, the component data and component configuration information may be directly read from a storage medium, or may be obtained by receiving external data.

[0059] In a specific implementation of the present application, component data and component configuration information may be obtained by receiving a request. That is, step S101 obtains component data and component configuration information corresponding to the target scene, which may specifically include:

[0060] Step 1: Receive a rendering request for the target scene.

[0061] The rendering request may carry relevant data information of the target scene. The rendering request may be a request issued by an upper layer application based on a user operation, or may be a rendering request obtained by monitoring the user operation.

[0062] Preferably, in order to facilitate user operation, the visual editing interface corresponding to the target scene can also be monitored to receive rendering requests. In other words, a visual editing interface can be pre-developed for scene rendering, in which the user can select the basic components to be used and input the relevant configuration of the components.

[0063] Step 2: Combine the basic component expression structure to parse the rendering request and obtain component data and component configuration information.

[0064] In this embodiment, relevant basic components can be pre-set and the basic component expression structure can be standardized, so that after receiving a rendering request, the rendering request can be parsed in combination with the basic component expression structure to obtain component data and component configuration information.

[0065] Among them, basic components can include point components, line components, surface components and body components. That is, each basic component realizes an independent effect or function. Each component is classified according to the characteristics and display methods of the basic components. According to these classifications, some constraints and communication mechanisms of component combinations can be defined to ensure direct communication between parent and child components and coexistence of sibling components. The type of the component itself provides a data reuse capability for the child components of the component and maintains the combination method of parent and child components.

[0066] Point-type components: This type of component can generally be rendered by simply specifying the position of the entire component in space. The data source is a specific point, and the component's capabilities are displayed at this specific point in three-dimensional space. For example, text marker components and shock wave effect components.

[0067] Line type components: This type of component generally needs to display the points of the line path in addition to the overall position of the group. The data source of the component is a series of data points, which form a path. The component will record the starting point and end point as well as the length of the entire path. The subcomponent can use parameters to locate the position of the line component. For example, line components and flying line components.

[0068] Face type components: In addition to displaying the position of the entire component, this type of component also needs to provide its own size range (usually represented by bounds). The bounds value includes the position points corresponding to the upper left and lower right. For example, the particle component, as a subcomponent of this type of component, will obtain the bounds of various components and display the particle effect range based on this bounds range.

[0069] Volume type components: In addition to displaying the position of the entire component, this type of component also has the characteristics of line type components and surface type components. It can be understood as a shape composed of multiple surfaces along the lines, that is, a volume. For example, a special building component has both height and roof surface, and each building has a fixed position display.

[0070] Component constraint specification: The combination of components in parallel is called a sibling relationship, and the combination of components in a superior-subordinate manner is called a parent-child relationship. Among them, the components in a sibling relationship require that the data provided by the common parent component of the components can be converted to meet their respective data format requirements. The components in a parent-child relationship are similar to the sibling relationship, except that the child component will inherit some properties of the parent component, such as position, range, etc., and the data will be passed from the parent component to the child component.

[0071] Among them, the basic component expression structure includes: basic component name, component structure change parameters, component drawing style parameters, and subcomponents of the current component.

[0072] The following is an example of the expression structure of the basic components in pseudo code:

[0073]

[0074]

[0075] That is to say, each component is represented by a piece of JSON (JavaScript Object Notation) code. The meaning of each field is as follows:

[0076] component: Enter the name of the component that has been developed.

[0077] Data: It is the normalization of user data. The data specification of each component is organized according to the structure of an array. There are three specific data specifications. The first is: [[], []……], the second is: [[[], [],……], [[], [],……]], and the third is [[[[], [],...], [[], [],...]], [[[], [],...], [[], [],...]]. According to the function of the component, each component has a fixed data format. For example, for point components and marker drawing, if a single point component is selected, the data format is the first method, [[lng,lat], [lng,lat]]; when there are two points, the data engine will draw them twice according to the two points, where lng represents longitude and lat represents latitude. If you choose the multi-point mass rendering component, you must select the second data type [[[lng,lat],[lng,lat],[lng,lat]]]. In this case, mass rendering will render all marker points in one batch. The data format returned by the user interface must follow this specification and must be converted in the component's data function (i.e., conversion function).

[0078] Layout: used to change some parameters of component shape. The usual parameter is the scale parameter. Other related parameters are related to the geometry of the 3D component. If the parameter value here is changed, the geometry needs to be recalculated or transformed.

[0079] Paint: is to change the parameters of the component rendering style, such as color, transparency, and some parameters without changing the geometry. The parameters of the component style can be changed in the GPU (Graphics Processing Unit). Each component will have relevant parameters provided to the outside to help users achieve customized effects. Of course, if the user does not provide these parameters, the component will use the default parameters to render.

[0080] Childrens: is an array value, the contents of which represent the child components of the component. For example, a text component can be used as a child component of a marker component, and the representation is:

[0081]

[0082]

[0083] Please refer to Figure 2 , Figure 2This is a schematic diagram of a combination of an icon component and a text component in this application, where the component corresponding to the words "Opening Ceremony Venue" in the upper left corner is the text component, the icon in the lower left corner is the icon component, and the component on the right that has both icons and words is a new component that combines the icon component and the text component. In this way, by combining the two components, a component with both icons and words is formed, which is also a combination of a point component and a component. For any such parent-child combination component, the data received by the parent component will be passed to the child component, and the child component will inherit the position of the parent component and adjust the position of the text through the offset.

[0084] This component with both icons and text can be used to mark points on the map. However, if the map includes three-dimensional buildings, such marked points are likely to be blocked by the buildings. In this case, a line component can be used to indicate the location on the ground. The line component needs to be combined with the component in the above figure into a more complex component. The component format is as follows:

[0085]

[0086]

[0087] Here, the marker component is a child component of the line component. The line component belongs to the linear component. The combination of the line component and the point component passes a parameter parentPathPointAt, and the value range of this parameter is [0,1]. Each child component will inherit the position of the parent component. For a linear component, you can only provide the child component with relative positioning relative to the line. By setting parentPathPointAt, if the value is 0, it means the starting point of the line, and if the value is 1, it means the end point of the line. Here, it is set to 1, which means the end point of the line, so the marker label is at the end point of the line.

[0088] It should be noted that the value returned by the data function of the line component is a fixed value, which means a line starting from [0,0,0] and ending at [0,0,1]. The coordinate system in the engine is in the Z direction, so it is a line with a length of 1 and pointing upward. The line width lineWidth is set in the layout, and scale is used to set the line length scaling rate. For example, if 30 is set, it means that the line length is magnified 30 times, that is, 1*30=30, and the current line length is 30. Another parameter coordinate can accept "xyz" or "geo", and the default is "geo". Here, setting "xyz" means that the data accepted by the component is metric data, that is, the line is 30 meters long. "geo" means that the location of the data is represented by geographic coordinates, that is, longitude and latitude are used to represent it.

[0089] Please refer to Figure 3 , Figure 3 This is a schematic diagram of a combination component and a line component in this application, wherein the component corresponding to the line in the upper left corner is the text component, and the component corresponding to the line in the lower left corner is the text component. Figure 2 The component with both text and icon shown is a combined component, and the complex component on the right is a new component that combines the previous two components.

[0090] Right now Figure 3 The graphic effect on the right is formed by the free combination of three components. If you want to add particle effects based on the above components, the component of the particle effect is the surface component. It needs to obtain an area as the activity range of the particles to display the particles. The building object is a volume component. The volume component contains the characteristics of the point component, the line component, and the surface component. The specific location of the building is the characteristic of the point component, the horizontal interface of the building is the characteristic of the surface component, and the height starting point and end point of the building are the characteristics of the line component. Let the particle component be a subcomponent of the building component. It can obtain the surface characteristics of the building and the range of the horizontal interface, and the particles will be displayed in this range. For specific effects, please refer to Figure 4 , Figure 4 It is a schematic diagram of the component combination effect with particle components in an embodiment of the present application.

[0091] Accordingly, the component code structure is as follows:

[0092]

[0093]

[0094] The particle component is a subcomponent of the building as a surface component. Through the parameter parentRange, the horizontal interface of the building can be obtained. With the addition of its own effect parameters, it can be perfectly displayed. At the same time, the components related to the mark become brother nodes. Another component used here is the light wall component, which is also a subcomponent of the building component. This component is a body component. By setting parentBoundBox, it will obtain the point features, line features, and surface features of the parent component building and then complete its own rendering. The rendering result will wrap a building with a highlighted shell to make the building more prominent. The effect is as follows Figure 5 As shown, Figure 5 This is a schematic diagram of the component combination effect of multiple components in an embodiment of the present application.

[0095] S102: Instantiate a root component based on component data and component configuration information.

[0096] The root component is the top-level parent of all components.

[0097] The process of creating an object using a class is called instantiation.

[0098] That is, after the user calls the interface provided by the rendering engine and passes the component data and component configuration to the engine layer, the engine parses the data passed by the user and the configuration file according to the initialization of the calling layer, and instantiates a root component as the top-level parent of all components.

[0099] S103. Using the root component, determine the global information of the rendering component according to the component data.

[0100] That is to say, the root component determines the global information of the rendering component, such as location information.

[0101] Specifically, the root component is used to determine the global information of the rendering component based on the component data, including:

[0102] Step 1: determine whether the normalized data of the root node includes a conversion function;

[0103] Step 2: If yes, use the conversion function to convert the component data as the position information of the entire component;

[0104] Step 3: If not, the default engine origin position is used as the position information of the entire component.

[0105] For ease of description, the above three steps are combined for explanation below.

[0106] That is, the root node is responsible for determining the global information such as the position of the rendering component based on the user's data. If the user defines a conversion function on the root component's data, the root component will convert the data passed in by the user according to the defined function as the position definition of the entire component. If the user does not set the data, the default engine's origin position is used as the position information of the entire component.

[0107] For example: if you want to draw some points, you don't need to define the data attribute value. The component data is passed downward, and the configuration is passed downward. The root component data that the point component will obtain is the number of origin points. After calculation, it is drawn at a specific position based on the data, and the relevant effects and sizes are rendered according to the configuration parameters. If you want to draw vertical lines at a series of positions, then the root component needs to define the data data, format it as [lng, lat] position information, and then draw the line component. Its own position is 0, relative to the position of the root component, and then its own data data returns a specific shape of a line. The general component will also receive data and configuration information passed from the root component. At this time, the line component will not accept the data of the root component, but obtain the position of the parent component when calculating its own position. The positions of the line segments of the line itself are relative positions, which are operated through its own scale data.

[0108] S104: Instantiate each component according to the layer structure to generate a rendering object.

[0109] Among them, each rendering object is stored in a scene.

[0110] That is, when each component is instantiated, a rendering object of the component is generated, and the rendering object exists in a scene.

[0111] That is to say, one component corresponds to one rendering object, and one rendering object corresponds to one scene. The scene manager can manage all scenes.

[0112] Specifically, step S104 instantiates each component according to the layer structure to generate a rendering object, which may specifically include: in the process of instantiating each component, generating geometry, materials and rendering objects, and obtaining corresponding information as the final position of the component according to the characteristics of the corresponding parent component; wherein the characteristics of the parent component include specific shape characteristics of the parent node, and the specific shape characteristics are point-like, line-like, surface-like or body-like.

[0113] That is to say, the layer will instantiate each component object according to the configuration information, and pass the corresponding data and configuration according to the configuration structure, until it finds that the value of the childrens attribute of the component configuration is empty. Each component must generate geometry, materials, and rendering objects during instantiation, and obtain corresponding information as the calculation method of its final position and area according to the characteristics of the parent component. Among them, the characteristics of the parent component are that the parent component is point-shaped, line-shaped, surface-shaped, and body-shaped. Specifically, when the child component requests these parent components, it will return different information. The point component will return its own position, the line component will return its own position, and its own internal method that returns a specific position (between the starting point and the end point of the line) according to the scale value. The surface component will provide a surface position and a method that can obtain the bound of the surface component. The body component will provide the position of the body, as well as the methods of the line component and the surface component. In this way, the child component can complete the initialization of its own position and range, and then the generated rendering object Mesh will have a scene manager to be responsible for it.

[0114] S105: The scene manager calls each corresponding scene to render the rendering object, and finally renders the entire target scene.

[0115] Specifically, the layer manager corresponding to the rendering frame in the target scene calls the scene manager, and the scene manager calls the rendering object. In other words, the rendering frame of the engine will call the layer manager, the layer manager will call the layer, and the corresponding layer manager calls the scene manager, and the scene manager calls the specific rendering object, thus completing the rendering of the entire target scene.

[0116] In each frame, the scene manager is called for updating, the scene manager updates each scene, and each scene renders the corresponding rendering object.

[0117] Please refer to Fig.10 , Fig.10 This is a specific schematic diagram of a rendering implementation in the embodiment of the present application. First, the engine initialization will call the layer manager initialization, the layer manager will initialize each layer, the layer will instantiate each component according to the initialization configuration information, and according to the rendering data, the generated rendering object will be stored in the corresponding scene. There is only one scene manager in the entire engine, and each scene is managed by the scene manager. In each frame of the engine, the scene manager is called for update, the scene manager will update each scene, and the scene will render each rendering object.

[0118] Apply the method provided in the embodiment of the present application to obtain component data and component configuration information corresponding to the target scene; based on the component data and component configuration information, instantiate a root component; the root component is the top-level parent of all components; use the root component to determine the global information of the rendering component according to the component data; instantiate each component according to the layer structure to generate a rendering object; wherein each rendering object is stored in a scene; the scene manager calls each corresponding scene to render the rendering object, and finally renders the entire target scene.

[0119] In this application, when it is necessary to render the target scene, it is only necessary to obtain the component data and component configuration information corresponding to the target scene, and then instantiate a root component based on the component data and component configuration information. Then, the global information of the rendering component can be determined with the help of the root component. A rendering object can be generated by instantiating each component, and each rendering object is stored in a scene. Therefore, the target scene can be rendered by calling the corresponding rendering object for rendering using the scene manager. In other words, in this application, the business scenario is decoupled from the component, that is, the component is not scenario-encapsulated, and when a scene needs to be rendered, there is no need to hard-code the various components of the current scene, that is, the scene rendering can be gradually realized in combination with the root component instantiated based on the component data and component configuration information, which can speed up the efficiency of visualization development.

[0120] Corresponding to the above method embodiment, the embodiment of the present application further provides a scene rendering device. The scene rendering device described below and the scene rendering method described above can refer to each other.

[0121] See also Figure 7 As shown, the device includes the following modules:

[0122] The data acquisition module 101 is used to acquire component data and component configuration information corresponding to the target scene;

[0123] The root component instantiation module 102 is used to instantiate a root component based on the component data and component configuration information; the root component is the top-level parent of all components;

[0124] A global information determination module 103, used to determine the global information of the rendering component according to the component data using the root component;

[0125] The component instantiation module 104 is used to instantiate each component according to the layer structure to generate a rendering object; wherein each rendering object is stored in a scene;

[0126] The scene rendering module 105 is used for the scene manager to call each corresponding scene to render the rendering object, and finally render the entire target scene.

[0127] Using the device provided in the embodiment of the present application, component data and component configuration information corresponding to the target scene are obtained; based on the component data and component configuration information, a root component is instantiated; the root component is the top-level parent of all components; using the root component, the global information of the rendering component is determined according to the component data; each component is instantiated according to the layer structure to generate a rendering object; wherein each rendering object is stored in a scene; the scene manager calls each corresponding scene to render the rendering object, and finally renders the entire target scene.

[0128] In this application, when it is necessary to render the target scene, it is only necessary to obtain the component data and component configuration information corresponding to the target scene, and then instantiate a root component based on the component data and component configuration information. Then, the global information of the rendering component can be determined with the help of the root component. A rendering object can be generated by instantiating each component, and each rendering object is stored in a scene. Therefore, the target scene can be rendered by calling the corresponding rendering object for rendering using the scene manager. In other words, in this application, the business scenario is decoupled from the component, that is, the component is not scenario-encapsulated, and when a scene needs to be rendered, there is no need to hard-code the various components of the current scene, that is, the scene rendering can be gradually realized in combination with the root component instantiated based on the component data and component configuration information, which can speed up the efficiency of visualization development.

[0129] In a specific embodiment of the present application, the component instantiation module 104 is specifically used to generate geometry, materials and rendering objects in the process of instantiating each component according to the layer structure, and obtain corresponding information as the final position of the component according to the characteristics of the corresponding parent component; wherein the characteristics of the parent component include specific shape characteristics of the parent node, and the specific shape characteristics are point-like, line-like, surface-like or body-like.

[0130] In a specific implementation of the present application, the global information determination module 103 is specifically used to determine whether the normalized data of the root node includes a conversion function; if so, the conversion function is used to convert the component data as the position information of the entire component; if not, the default engine's origin position is used as the position information of the entire component.

[0131] In a specific implementation of the present application, the scene rendering module 105 is specifically used to call the scene manager for updating in each frame, and the scene manager updates each scene, and each scene renders each corresponding rendering object.

[0132] In a specific implementation of the present application, the data acquisition module 101 is specifically used to receive a rendering request of a target scene; and parse the rendering request in combination with the basic component expression structure to obtain component data and component configuration information.

[0133] In a specific implementation of the present application, the data acquisition module 101 is specifically used to monitor the visual editing interface corresponding to the target scene to receive a rendering request.

[0134] In a specific implementation of the present application, the data acquisition module 101 is specifically used for the basic component name, component structure change parameters, component drawing style parameters, and subcomponents of the current component.

[0135] Corresponding to the above method embodiment, an embodiment of the present application further provides an electronic device. The electronic device described below and the scene rendering method described above can refer to each other.

[0136] See also Figure 8 As shown, the electronic device includes:

[0137] A memory 332, for storing computer programs;

[0138] The processor 322 is used to implement the steps of the scene rendering method of the above method embodiment when executing the computer program.

[0139] For details, please refer to Fig. 9 , Fig. 9A specific structural diagram of an electronic device provided for this embodiment, the electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 322 (for example, one or more processors) and a memory 332, and the memory 332 stores one or more computer applications 342 or data 344. Among them, the memory 332 can be a temporary storage or a permanent storage. The program stored in the memory 332 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the data processing device. Furthermore, the central processing unit 322 can be configured to communicate with the memory 332 to execute a series of instruction operations in the memory 332 on the electronic device 301.

[0140] The electronic device 301 may further include one or more power supplies 326 , one or more wired or wireless network interfaces 350 , one or more input and output interfaces 358 , and / or one or more operating systems 341 .

[0141] The steps in the scene rendering method described above can be implemented by the structure of an electronic device.

[0142] Corresponding to the above method embodiment, the embodiment of the present application further provides a readable storage medium. The readable storage medium described below and the scene rendering method described above can refer to each other.

[0143] A readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the scene rendering method of the above method embodiment are implemented.

[0144] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.

[0145] Those skilled in the art may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

Claims

1. A scene rendering method, characterized in that: include: Obtain component data and component configuration information corresponding to the target scenario; Instantiate a root component based on the component data and the component configuration information; The root component is the top-level parent of all components; Using the root component, determining global information of a rendering component according to the component data; Instantiating each of the components according to the layer structure to generate a rendering object; wherein each of the rendering objects is stored in a scene; The scene manager calls each corresponding scene to render the rendering object, and finally renders the entire target scene; The instantiation of each of the components according to the layer structure to generate a rendering object includes: In the process of instantiating each of the components, a geometry, a material and the rendering object are generated, and corresponding information is obtained as the final position of the component according to the characteristics of the corresponding parent component; wherein the characteristics of the parent component include specific shape characteristics of the parent node, and the specific shape characteristics are point-shaped, line-shaped, surface-shaped or body-shaped; Wherein, using the root component and determining the global information of the rendering component according to the component data includes: Determining whether the normalized data of the root component includes a conversion function; If yes, converting the component data into position information of the entire component using the conversion function; If not, the default engine's origin position is used as the position information of the entire component.

2. The scene rendering method according to claim 1, characterized in that: The scene manager calls each corresponding scene to render the rendering object, and finally renders the entire target scene, including: In each frame, the scene manager is called to perform updating, the scene manager updates each of the scenes, and each of the scenes renders each of the corresponding rendering objects.

3. The scene rendering method according to claim 1 or 2, characterized in that: The obtaining of component data and component configuration information corresponding to the target scene includes: Receiving a rendering request for the target scene; In combination with the basic component expression structure, the rendering request is parsed to obtain the component data and the component configuration information.

4. The scene rendering method according to claim 3, characterized in that: Receiving a rendering request for the target scene, including: The visual editing interface corresponding to the target scene is monitored to receive the rendering request.

5. The scene rendering method according to claim 3, characterized in that: The basic component expression structure includes: Basic component name, component structure change parameters, component drawing style parameters, and subcomponents of the current component.

6. A scene rendering device, characterized in that: include: Data acquisition module, used to obtain component data and component configuration information corresponding to the target scene; A root component instantiation module, used to instantiate a root component based on the component data and the component configuration information; the root component is the top-level parent of all components; A global information determination module, used to determine the global information of the rendering component according to the component data using the root component; A component instantiation module, used to instantiate each of the components according to the layer structure to generate a rendering object; wherein each of the rendering objects is stored in a scene; A scene rendering module, which is used for the scene manager to call each corresponding scene to render the rendering object, and finally render the entire target scene; The component instantiation module is specifically used to generate the geometry, material and rendering object in the process of instantiating each component, and obtain the corresponding information as the final position of the component according to the characteristics of the corresponding parent component; wherein the characteristics of the parent component include the specific shape characteristics of the parent node, and the specific shape characteristics are point-shaped, line-shaped, surface-shaped or body-shaped; Among them, the global information determination module is specifically used to determine whether the normalized data of the root component includes a conversion function; if so, the conversion function is used to convert the component data as the position information of the entire component; if not, the default engine's origin position is used as the position information of the entire component.

7. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the scene rendering method according to any one of claims 1 to 5 when executing the computer program.

8. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the scene rendering method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Processing method, rendering method and device for static component in game scene

    CN108339270A

  • Interface rendering method and device, electronic equipment and medium

    CN111338626A