Scene model rendering method, device and equipment

By creating low-precision and high-precision models in educational applications, and drawing the light, shadow, and color information of the high-precision model into a map and passing it to the low-precision model, the rendering burden problem caused by baking the low-precision model from the high-precision model is solved, and a more efficient rendering process is achieved.

CN114119818BActive Publication Date: 2025-09-05HONGEN PERFECT (BEIJING) EDUCATION TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111372560.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-18
Publication Date
2025-09-05
Estimated Expiration
2041-11-18

AI Technical Summary

Technical Problem

The existing method of baking a low-precision model from a high-precision model requires adding a large amount of material production process, resulting in an increase in rendering batches and performance consumption.

Method used

Create low-precision models and high-precision models for the materials in the static scene to be rendered, set the environmental information to render the high-precision model, obtain light, shadow and color information, and draw this information into a map and pass it to the low-precision model for rendering using the rendering engine.

Benefits of technology

The production process of normal maps and specular maps is reduced during the rendering process, which saves the performance consumption of the rendering engine and reduces the rendering batch.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119818B_ABST
    Figure CN114119818B_ABST
Patent Text Reader

Abstract

The present application discloses a rendering method, device and equipment for a scene model, which relates to the field of rendering technology. The entire rendering process does not require the addition of normal maps and highlight maps, thus avoiding the production process of a large number of texture materials in the scene, saving performance consumption on the rendering engine side to a certain extent, and reducing rendering batches. The method includes: creating a low-precision model and a high-precision model of the scene object for the materials in the static scene to be rendered; setting the environmental information in the static scene to be rendered, and using the environmental information to render the high-precision model to obtain light and shadow information and color information; by making a low-precision model to align with the high-precision model, the light and shadow information and color information obtained by rendering the high-precision model are drawn into a color map and a light map, and passed to the low-precision model; transmitting the low-precision model carrying the color map and light map to the rendering engine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of rendering technology, and in particular to a method, device and equipment for rendering a scene model. Background Art

[0002] With the continuous development of online education, educational applications are constantly emerging, with corresponding educational content, types of education, and educational functions constantly increasing. It is even possible to add games or animations to educational applications to help children improve their knowledge, vision, thinking, and other abilities. Using computer 3D and simulation technologies to generate game or animation scenes for educational applications allows users to have a more realistic perception of the scene models from their own perspective. The rendering function of computer software can also be used to visualize game or animation scenes.

[0003] In scene model design, due to the ever-changing and complex nature of the real world, users have higher requirements for scene rendering. The level of detail of scene objects has increased significantly, and dynamic lighting and normal mapping are applied to scene model rendering. Related technologies mainly include two methods for scene model creation. One method is to use a low-precision model with hand-drawn textures. The designer uses 3D production to recreate the original 3D shape based on the original image. Because the model has a low number of polygons, the final effect is mainly achieved by hand-drawn textures. To achieve more realistic and detailed scene models, the other method is to bake a high-precision model into a low-precision model. The designer first draws details on the high-precision model, and then creates normal maps and other textures and applies them to the low-precision model. This allows the low-precision model to appear lifelike in game scenes or animations. However, this method requires a large number of resource creation processes, which require engine calculations. This increases the rendering burden of the scene model, resulting in increased rendering batches and performance consumption. Summary of the Invention

[0004] In view of this, the present application provides a rendering method, device and equipment for a scene model, the main purpose of which is to solve the problem that the method of baking a low-precision model from a high-precision model in the existing technology requires the addition of a large amount of material production process, which increases the rendering burden of the scene model and leads to increased rendering batches and performance consumption.

[0005] According to a first aspect of the present application, a method for rendering a scene model is provided, which is applied to a terminal device for producing an educational application, comprising:

[0006] Create low-precision models and high-precision models of scene objects for the materials in the static scene to be rendered;

[0007] Setting environmental information in the static scene to be rendered, and rendering the high-precision model using the environmental information to obtain light and shadow information and color information;

[0008] The low-precision model is made to align with the high-precision model, and a color map and a light map are drawn using the light and shadow information and color information obtained by rendering the high-precision model, and the color map and the light map are transferred to the low-precision model;

[0009] The low-precision model carrying the color map and the light map is transmitted to a rendering engine, so that the rendering engine renders the low-precision model according to the color map and the light map.

[0010] Furthermore, the step of creating a low-precision model and a high-precision model of the scene objects for the materials in the static scene to be rendered specifically includes:

[0011] For the materials in the static scene to be rendered, use the drawing command to create a low-precision model of the scene object using the initial model as a prototype;

[0012] A high-precision model of the scene object is created by performing edge and corner line addition and mesh smoothing processing on the low-precision model, so that the high-precision model has smoother corners than the low-precision model.

[0013] Furthermore, the setting of the environmental information in the static scene to be rendered and rendering the high-precision model using the environmental information to obtain light and shadow information and color information specifically includes:

[0014] Using light attribute parameters to simulate the lighting effect in the static scene to be rendered, and setting the light and shadow parameters and color parameters assigned to the high-precision model;

[0015] The high-precision model is rendered using the light and shadow parameters and color parameters to obtain light and shadow information and color information.

[0016] Furthermore, the step of aligning the high-precision model with the low-precision model and drawing a color map and a light map using the light and shadow information and color information obtained by rendering the high-precision model to transmit the color map and the light map to the low-precision model specifically includes:

[0017] Placing the low-precision model and the precision model at the same position in three-dimensional space;

[0018] Using a mapping function for the low-precision model, selecting a mapping source to the high-precision model, and modifying a mapping framework on the mapped low-precision model so that all parts of the high-precision model are completely wrapped in the mapping framework;

[0019] Selecting the low-precision model with mapping, and using a baking function to draw the light and shadow information and color information obtained by rendering the high-precision model onto a texture resource map of a preset material type formed by unfolding the low-precision model, to obtain a light map and a color map;

[0020] Map the lightmap and colormap back to the low-poly model.

[0021] Furthermore, before selecting the low-precision model with the mapping and using the baking function to draw the light and shadow information and color information obtained by rendering the high-precision model onto a texture resource map of a preset material type formed by unfolding the low-precision model to obtain the light map and color map, the method further includes:

[0022] Setting texture mapping coordinate information of the low-precision model, and cutting and unfolding the low-precision model according to the texture mapping coordinate information to obtain a texture resource map;

[0023] Different materials are added to the texture resource map to obtain texture resource maps of different material types.

[0024] Furthermore, the setting of texture map coordinate information of the low-precision model, and cutting and unfolding the low-precision model according to the texture map coordinate information to obtain a texture resource map specifically includes:

[0025] Setting texture mapping coordinate information of the low-precision model, using the texture mapping coordinate information as a drawing segmentation line, and dividing the low-precision model into a plurality of facets;

[0026] Select the elements in the patch by editing the polygon box, and expand the selected elements to obtain the texture resource map.

[0027] According to a second aspect of the present application, a method for rendering a scene model is provided, which is applied to a client running an educational application, comprising:

[0028] Receiving a low-precision model carrying a color map and a light map, and reading vector resource information in the low-precision model;

[0029] Using the vector resource information, performing highlight control on the color map and the light map in a fragment shader, and calculating the highlight color information of each pixel using an interpolation function;

[0030] The low-precision model is pixel-filled using the highlight color information, and a rendering result of the scene model is output.

[0031] Furthermore, the reading of the vector resource information in the low-precision model specifically includes:

[0032] Respectively read the normal vector, light vector and view vector of the low-precision model in the world space;

[0033] A half-angle vector is obtained by taking the dot product of the viewing angle vector and the light vector, and is combined with the normal vector to form vector resource information.

[0034] Furthermore, the use of the vector resource information to perform highlight control on the color map and the light map in the fragment shader, and using an interpolation function to calculate the highlight color information of each pixel, specifically includes:

[0035] Determine a highlight value using the normal vector and the half-angle vector;

[0036] Using the highlight value to adjust the intensity of the light map in the fragment shader and then superimposing it on the color map to obtain an intensity range of the highlight color;

[0037] An interpolation function is used to calculate the highlight color information of each pixel according to the intensity range of the highlight color.

[0038] According to a third aspect of the present application, a scene model rendering device is provided, which is applied to a terminal device for producing educational applications, comprising:

[0039] A creation unit, configured to create a low-precision model and a high-precision model of scene objects respectively for materials in a static scene to be rendered;

[0040] A setting unit, configured to set environmental information in the static scene to be rendered, and render the high-precision model using the environmental information to obtain light and shadow information and color information;

[0041] a production unit, configured to produce the low-precision model to align the high-precision model, and to draw a color map and a light map using light and shadow information and color information obtained by rendering the high-precision model, and transmit the color map and the light map to the low-precision model;

[0042] A transmission unit is used to transmit the low-precision model carrying the color map and the light map to a rendering engine, so that the rendering engine renders the low-precision model according to the color map and the light map.

[0043] Furthermore, the creation unit includes:

[0044] The first creation module is used to create a low-precision model of the scene object using the initial model as a prototype using a drawing command for the material in the static scene to be rendered;

[0045] The second creation module is used to create a high-precision model of the scene object by adding edges and corners and performing mesh smoothing processing on the low-precision model, so that the high-precision model has more rounded corners than the low-precision model.

[0046] Furthermore, the setting unit includes:

[0047] A simulation module, configured to simulate the lighting effects in the static scene to be rendered using light attribute parameters, and to set light and shadow parameters and color parameters assigned to the high-precision model;

[0048] A rendering module is used to render the high-precision model using the light and shadow parameters and color parameters to obtain light and shadow information and color information.

[0049] Furthermore, the production unit includes:

[0050] A placement module, configured to place the low-precision model and the precision model at the same position in three-dimensional space;

[0051] a modification module, configured to use a mapping function for the low-precision model, select a mapping source to the high-precision model, and modify a mapping framework on the mapped low-precision model so that all parts of the high-precision model are completely wrapped in the mapping framework;

[0052] A drawing module, configured to select the low-precision model with the mapping, and use a baking function to draw the light and shadow information and color information obtained by rendering the high-precision model onto a texture resource map of a preset material type formed by unfolding the low-precision model, thereby obtaining a light map and a color map;

[0053] A pasting module is used to paste the light map and color map back to the low-precision model.

[0054] Furthermore, the production unit further includes:

[0055] an unfolding module, configured to, before selecting the low-precision model with the mapping, use a baking function to draw the light and shadow information and color information obtained by rendering the high-precision model onto the texture resource map unfolded by the low-precision model, thereby forming a light map and a color map, set texture map coordinate information of the low-precision model, and then unfold the low-precision model after cutting it according to the texture map coordinate information to obtain a texture resource map;

[0056] The adding module is used to add different materials to the texture resource map to obtain texture resource maps of different material types.

[0057] Furthermore, the unfolding module is specifically used to set texture mapping coordinate information of the low-precision model, and use the texture mapping coordinate information as a drawing dividing line to divide the low-precision model into a plurality of facets;

[0058] The unfolding module is further specifically used to select elements in a patch by editing a polygon frame, and unfold the selected elements to obtain a texture resource map.

[0059] According to a fourth aspect of the present application, a scene model rendering device is provided, which is applied to a client running an educational application, comprising:

[0060] A reading unit, configured to receive a low-precision model carrying a color map and a light map; and read vector resource information from the low-precision model;

[0061] A control unit, configured to use the vector resource information to perform highlight control on the color map and the light map in a fragment shader, and to calculate the highlight color information of each pixel using an interpolation function;

[0062] A rendering unit is used to use the highlight color information to fill pixels of the low-precision model and output a rendering result of the scene model.

[0063] Furthermore, the reading unit is specifically used to read the normal vector, light vector and view vector of the low-precision model in the world space respectively;

[0064] The reading unit is further configured to obtain a half-angle vector by using the dot product of the viewing angle vector and the light vector, and form vector resource information in combination with the normal vector.

[0065] Furthermore, the control unit includes:

[0066] a determination module, configured to determine a highlight value using the normal vector and the half-angle vector;

[0067] An adjustment module, configured to use the highlight value to adjust the intensity of the light map in a fragment shader and then superimpose the light map onto the color map to obtain an intensity range of the highlight color;

[0068] A calculation module is used to calculate the highlight color information of each pixel using an interpolation function according to the intensity range of the highlight color.

[0069] According to a fifth aspect of the present application, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described in the first aspect when executing the computer program.

[0070] According to a sixth aspect of the present application, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0071] By means of the above-mentioned technical scheme, the present application provides a method, device and equipment for rendering a scene model. Compared with the current existing technology that requires the addition of a large amount of material production process to render the scene model, the present application creates a low-precision model and a high-precision model of the scene object for the material in the static scene to be rendered, sets the environmental information in the static scene to be rendered, and uses the environmental information to render the high-precision model to obtain light and shadow information and color information. By making a low-precision model to align with the high-precision model, the light and shadow information and color information obtained by rendering the high-precision model are drawn into a color map and a light map, and passed to the low-precision model, so that the low-precision model has the lighting effect of the high-precision model, and further transmits the low-precision model carrying the color map and the light map to the rendering engine, so that the rendering engine renders the low-precision model according to the color map and the light map. The entire rendering process does not require the addition of normal maps and highlight maps, thereby avoiding the production process of a large amount of map materials in the scene, saving performance consumption on the rendering engine end to a certain extent, and reducing rendering batches.

[0072] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0074] Figure 1 A schematic diagram of a process for rendering a scene model provided in an embodiment of the present application is shown;

[0075] Figure 2 A schematic diagram showing a flow chart of another scene model rendering method provided in an embodiment of the present application is shown;

[0076] Figure 3 A schematic diagram showing a flow chart of another scene model rendering method provided in an embodiment of the present application is shown;

[0077] Figure 4 A schematic diagram showing a flow chart of another scene model rendering method provided in an embodiment of the present application is shown;

[0078] Figure 5A schematic structural diagram of a scene model rendering device provided in an embodiment of the present application is shown;

[0079] Figure 6 A schematic structural diagram of another scene model rendering device provided in an embodiment of the present application is shown;

[0080] Figure 7 A schematic structural diagram of another scene model rendering device provided in an embodiment of the present application is shown;

[0081] Figure 8 A schematic structural diagram of another scene model rendering device provided in an embodiment of the present application is shown;

[0082] Figure 9 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0083] The present invention will now be discussed with reference to several exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the present invention, rather than to imply any limitation on the scope of the present invention.

[0084] As used herein, the term "including" and variations thereof are to be interpreted as open-ended terms meaning "including, but not limited to." The term "based on" is to be interpreted as "based, at least in part, on." The terms "one embodiment" and "an embodiment" are to be interpreted as meaning "at least one embodiment." The term "another embodiment" is to be interpreted as meaning "at least one other embodiment."

[0085] With the continuous development of online education, educational applications continue to emerge, and the corresponding educational content, types of education and educational functions continue to increase. You can even add games or animations to educational applications to help children improve their knowledge, vision, thinking and other abilities. For example, educational applications with identification functions can help children identify various animals by displaying the habits, growth environment, daily food, etc. of animals in the application. Educational applications with hand-drawing functions can allow children to hand-draw various animals by displaying drawing boards and pictures of corresponding animals in the application.

[0086] For scene objects that appear in educational applications, such as small leaves, stone pestles, and wooden stakes, in order to achieve realism and create more detailed scene models, a high-precision model can be baked into a low-precision model. The details drawn under the high-precision model are used to create normal maps and other textures, and then assigned to the low-precision model. This allows the low-precision model to appear lifelike in game or animation scenes. However, baking a high-precision model into a low-precision model requires the addition of a large number of material production processes, all of which require engine calculations. This increases the rendering burden of the scene model, leading to increased rendering batches and performance consumption.

[0087] In order to solve this problem, this embodiment provides a rendering method of a scene model, such as Figure 1 As shown, the method is applied to a terminal device for producing an educational application, and includes the following steps:

[0088] 101. Create low-precision models and high-precision models of scene objects for the materials in the static scene to be rendered.

[0089] Scene design for educational applications is a crucial step in application production. For educational scenarios, software tools are needed to model the materials in the scene. Specifically, a basic cube can be created using software tools. The initial model is established by adding vertices, extrusion, chamfering, and other methods and commands. The initial model is then adjusted based on the material's outline to create a model of the scene object. The materials in the static scene to be rendered here can be leaves, stones, wooden stakes, chairs, and so on. A cartoon-style educational scene is used as an example. First, determine the materials needed in the scene, including a tiger cub, pond, house, wooden stakes, trees, and so on. The materials in the scene are then positioned and laid out. Software tools are then used to create models of the scene objects based on the prototypes of each material.

[0090] Since the models of scene objects are composed of several faces, and each face is composed of vertices and edges, the shape of the object can be changed by modifying the model of the scene object, for example, multiple vertices can be collapsed into a single vertex. Specifically, when creating educational scenes, the vertex data of the scene object model can be set using the Vertex Painter modifier. For example, vertex colors can be drawn on the scene object model, which points are drawn face by face, and vertex lighting can be controlled. The set vertex data can then be used to render the scene object model.

[0091] Typically, models used to create scene objects for materials can include low-precision models and high-precision models. Low-precision models have a lower face count and rely primarily on hand-drawn textures to achieve scene effects. Furthermore, given device performance limitations, the face count of scene models needs to be optimized as much as possible to strike a balance between hardware performance and face count, achieving the best scene quality with the least amount of footage. High-precision models have a higher face count, complex structure, and rich details, and can be used to bake normals, AO, lighting, and other textures onto matching modules.

[0092] The execution subject of this embodiment can be a rendering device or equipment for the scene model, which can be configured on the scene production client. The scene production client can create high-precision models and low-precision models of scene objects based on the materials in the scene, and edit the high-precision models and low-precision models. Vertex data can be used to control the number of model faces and detailed features in the model, thereby displaying scene models with different precision effects. Specifically, in the process of rendering the scene model, since educational applications are usually rendered in real time during use, and real-time rendering has a low frame rate requirement, a better rendering effect will be obtained.

[0093] 102. Setting environmental information in the static scene to be rendered, and using the environmental information to render the high-precision model to obtain light and shadow information and color information.

[0094] In practical applications, due to the characteristics of high-precision models such as many details and a high number of faces, it is difficult to run them in real time in the rendering engine. In order to make the scene show a more realistic effect, the detailed feature information of the high-precision model can be added to the low-precision model. The low-precision model has fewer faces than the high-precision model. It is optimized while ensuring the matching of the scene object contours. While streamlining the number of faces, reasonable wiring is performed to facilitate the production of subsequent scene objects, so that the low-precision model can also present the effect of the high-precision model without using too many model faces.

[0095] The environmental information in the static scene to be rendered here may include various light and shadow information and color information received by the scene. Usually, different types of lighting are arranged for different scenes. For outdoor scenes with clear skies, skylight, sunlight and other lighting can be arranged. For special indoor scenes, candles, indoor lights and other lighting can be arranged. For outdoor scenes at night, street lights, flashlights and other lighting can be arranged. The lighting arranged in the scene can be used to illuminate the scene model, thereby capturing the environmental information received by the scene model in the scene, and rendering the output light and shadow information and color information.

[0096] In actual application scenarios, panoramic lighting can be used to simulate the brightness and color of each angle of the environment to illuminate the scene model. Manual lighting can also be combined to meet the scene's lighting needs. The environmental information in the scene can be further used to render the output light information and color information. The simulation of the skylight effect is used as an example to illustrate. For the model in the static scene to be rendered, first arrange the appropriate camera and create a standard light skylight. By dragging the skylight position to the target position, set the skylight to be enabled, and further adjust the parameters in the skylight, you can use light shading and rendering to illuminate the scene. Use the "Multiplier" parameter to control the power of the skylight. For example, if the parameter is 2, the light will be twice as bright. Use "Light Offset" to specify the shortest distance for casting shadows on a point in the scene. It mainly controls the shadow state caused by the light in the scene. When "Light Offset" is set to 0, the point can cast a shadow on itself. A higher parameter can prevent objects near the point from casting shadows on the point. Use the "Skylight Color" parameter to color the skylight.

[0097] 103. The low-precision model is made to align with the high-precision model, and a color map and a light map are drawn using the light and shadow information and color information obtained by rendering the high-precision model, and the color map and the light map are passed to the low-precision model.

[0098] It is understandable that although the high-precision model has better detail effects, considering that the high-precision model has too many faces when expanding the texture coordinates, it takes up a lot of computing resources in the rendering process. The low-precision model can easily expand the texture coordinates in the rendering engine, and can be affixed with detailed maps to achieve an effect close to the high-precision model. Here, by making a low-precision model opposite the high-precision model, the detail information of the high-precision model can be passed to the low-precision model, so that the low-precision model does not need to occupy excessive computing resources in the rendering engine to show the detail effect of the high-precision model.

[0099] In the process of making a low-precision model to align with a high-precision model, we mainly rely on mapping to achieve a smoothness and delicacy close to that of the high-precision model. The more detailed the texture is, the better the effect. Since the mapping is done after the model is disassembled and then aligned on the basis of the unfolded texture coordinate vertices, the alignment and perspective changes are different from normal images. Unfolding the texture coordinates requires less stretching or deformation. For example, the closer the grid is to a square, the higher the effect of the texture coordinate unfolding is, ensuring that the mapping will not be distorted. Generally, the higher the overall light perception of the map, the better the effect on the low-precision model. Here, the light and shadow information and color information obtained by rendering the high-precision model are drawn into color maps and light maps to export the light and shadow details and color details of the high-precision model, and the color maps and light maps are baked and passed to the low-precision model to increase the expressiveness of the low-precision model.

[0100] 104. Transmit the low-precision model carrying the color map and the light map to a rendering engine, so that the rendering engine renders the low-precision model according to the color map and the light map.

[0101] It is understandable that when transmitting low-precision models, considering the complexity of the model structure, modeling tools are often used in actual applications. A specific data format is required to save the low-precision model as a file and hand it over to the rendering engine for drawing. At this time, after receiving the file saved as the model, the rendering engine needs to parse it according to the format of the model file and read it into the project for rendering.

[0102] Specifically in the rendering engine, on the one hand, the model outline is drawn by reading the vertex information in the model file, and on the other hand, the model light and shadow effects are filled in by reading the color map and light map in the model file, and rendering is performed according to the drawn model outline and the filled light and shadow effects.

[0103] The rendering method of the scene model provided in the embodiment of the present application is compared with the current existing technology that requires adding a large amount of material production process to render the scene model. The present application creates a low-precision model and a high-precision model of the scene object for the material in the static scene to be rendered, sets the environmental information in the static scene to be rendered, and uses the environmental information to render the high-precision model to obtain light and shadow information and color information. By making a low-precision model to align with the high-precision model, the light and shadow information and color information obtained by rendering the high-precision model are drawn into a color map and a light map, and passed to the low-precision model, so that the low-precision model has the lighting effect of the high-precision model, and further transmits the low-precision model carrying the color map and the light map to the rendering engine, so that the rendering engine renders the low-precision model according to the color map and the light map. The entire rendering process does not require the addition of normal maps and highlight maps, thereby avoiding the production process of a large amount of map materials in the scene, saving performance consumption on the rendering engine end to a certain extent, and reducing rendering batches.

[0104] Furthermore, as educational application scenarios continue to change, the position status of scene objects on the screen will also change accordingly. This position status will affect, to a certain extent, the baking timing of the low-precision model for the high-precision model in the static scene to be rendered. In order to improve the accuracy of model alignment, before creating low-precision models and high-precision models of scene objects for the materials in the static scene to be rendered, the position status of the scene objects on the screen can be used to set a trigger mechanism for aligning the low-precision model and the high-precision model, and the trigger mechanism can be used to determine whether to execute the process of aligning the low-precision model with the high-precision model. The specific process is as follows: Figure 2 As shown, this can be achieved by performing the following steps:

[0105] 105. Divide the application scene into a plurality of scene areas to be rendered according to the position states of the scene objects on the screen.

[0106] Among them, the position status of the scene object on the screen can reflect the position information of the scene at the current moment in the application scene, for example, the scene object is at one-third of the screen, the scene object is in the upper half of the screen, and it can also reflect the dynamic changes of the scene object at different moments in the application scene, for example, the scene object moves from position A to position B, and the scene object falls from the tree. In the process of dividing the application scene into multiple scene areas to be rendered, the same type of scene objects can be aggregated according to the position status of the scene object on the screen to form a scene object set, and the application scene is divided according to the area corresponding to the scene object set. The scene area to be rendered after division may not contain any scene objects, may have one scene object, or may contain multiple scene objects of the same type.

[0107] 106. In response to a rendering instruction of a scene object, determine whether a scene area to be rendered mapped by the rendering instruction covers a preset area range.

[0108] It is understandable that for the scene area to be rendered containing scene objects, it is usually necessary to make a low-precision model to align with the high-precision model during the rendering process to ensure that the low-precision model has a more realistic display effect during the rendering process.

[0109] The implementation process of specific rendering instructions is usually executed point by point along the pixels on the screen and mapped to different scene areas to be rendered. When the scene area to be rendered covers the preset area range, it means that the rendering instruction is executed to the area to be rendered that covers the scene object. The preset area range here is the position area set for the scene object in the screen. Of course, in order to save production resources, the preset area range can also be the position area set for the key scene objects in the screen. That is to say, only low-precision models are made for key scene objects to match high-precision models, while other scene objects can use low-precision models. Of course, in order to ensure the display effect of scene objects in the screen, the preset area range can also be a fixed position area in the screen, preferably the middle position area of ​​the screen.

[0110] If so, create low-precision and high-precision models of the scene objects for the static scene assets within the scene area to be rendered. Because the scene area to be rendered, covering the preset range, usually contains scene objects, and the lighting and color of scene objects in a static scene are static, creating a low-precision model to align with the lightmap and colormap of the high-precision model will achieve better rendering results.

[0111] Furthermore, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, this embodiment provides another method for rendering a scene model, such as Figure 3 As shown, the method includes:

[0112] 201. For the material in the static scene to be rendered, use the drawing command to create a low-precision model of the scene object using the initial model as a prototype.

[0113] Among them, the initial model serves as the initial structure of the material in the game scene to be rendered. Here, the outlines of the required materials in the real scene, such as rocks, tree trunks, ground covers, etc., can be copied through the software tools to form the initial model resources of the corresponding materials. The initial model resources can be further detailed using the drawing commands to adjust the outline details and create a low-precision model of the scene object. For example, the curvature of the tree trunk can be modified, and concave and convex lines can be added to the ground cover.

[0114] It is understandable that, for convenience, scanning technology can be used to extract the required materials in the real scene, decompose them into initial model resources and then combine them for use, and then use drawing commands to create low-precision models of scene objects based on the combined initial model resources.

[0115] 202. Create a high-precision model of the scene object by performing edge and corner line addition and mesh smoothing processing on the low-precision model, so that the high-precision model has more rounded corners than the low-precision model.

[0116] Since the low-precision model is composed of points, lines, surfaces, geometry and other elements, for the edge and corner line processing, you can set corner points or vertices on the lines in the low-precision model, and add lines to the low-precision model by adding lines at the corner points. You can also connect the corner points or vertices to add lines to the low-precision model; for mesh smoothing, you can convert the low-precision model into an editable polygon, add a mesh smooth modifier to the low-precision model, change the degree of smoothing by modifying the subdivision method, then change the degree of smoothing by adjusting the number of iterations, and finally modify the smoothing parameters by changing the smoothing parameter group.

[0117] Here, the low-precision model is processed by adding lines to the corners and smoothing the mesh, and the relatively hard corners and lines in the low-precision model are subdivided, so that the processed high-precision model has more faces and richer detail features, and has smoother corners than the low-precision model.

[0118] 203. Use light attribute parameters to simulate the lighting effect in the static scene to be rendered, and set light and shadow parameters and color parameters assigned to the high-precision model.

[0119] It is understandable that since light in real life has characteristics such as reflection, refraction, and diffraction, the simulation of basic characteristics can achieve lighting effects with different light characteristics. In practical applications, various methods can be used to adjust the light attribute parameters to further simulate the lighting effects in the static scene to be rendered, and set the light and shadow parameters and color parameters assigned to the high-precision model. For example, manually draw soft shadows on the map, or use a weak area light source to illuminate the dark part of the object to simulate diffuse reflection and other phenomena.

[0120] The specific simulation process can include the following methods: directly simulating the forward process of light from being emitted by the light source to being completely absorbed by the object; instead of directly simulating the light, reversely collecting the light intensity at specific points on the surface of the object to simulate the actual lighting effect; or completely ignoring the behavior of light and simply simulating the lighting effect based on the phenomenon that the closer the scene object is to other objects, the weaker the illumination received by the reflected light. There is no limitation on the method of simulating the lighting effect in the static scene to be rendered.

[0121] When setting the light and shadow parameters and color parameters assigned to the high-precision model, you can use simulated lighting effects to cool the scene, set the light and shadow parameters by increasing or decreasing the light intensity, and set the color parameters by setting or mixing the light color percentage.

[0122] Furthermore, in order to improve the display effect of the high-precision model, the light and shadow parameters and color parameters are set based on the material of the high-precision model. After simulating the lighting effect, different light and shadow parameters and color parameters can be formed for high-precision models of different materials.

[0123] 204. Render the high-precision model using the light and shadow parameters and the color parameters to obtain light and shadow information and color information.

[0124] It can be understood that the light and shadow parameters and color parameters here are set by continuously adjusting after simulating the lighting effect. The light and shadow information and color information obtained after rendering the high-precision model using the light and shadow parameters and color parameters have a satisfactory visual effect.

[0125] In the rendering process of actual application scenarios, taking trees as an example, a small group of leaves can be selected to make high-precision models and low-precision models, and the light and shadow parameters and color parameters can be set by hanging material balls and adjusting the lights. If there are a lot of leaves, highlight corners can be added to achieve a satisfactory visual effect, and the lighting parameters and color parameters can be used to render the high-precision model to obtain light and shadow information and color information. The light and shadow information and color information here contain the detailed texture features on the high-precision model. Since the light and shadow and color in the scene are fixed for the static scene to be rendered, the detailed texture features can show a directional highlight effect, which is more realistic.

[0126] 205. The low-precision model is made to align with the high-precision model, and a color map and a light map are drawn using the light and shadow information and color information obtained by rendering the high-precision model, and the color maps are passed to the low-precision model.

[0127] In this step, the low-precision model and the high-precision model can be placed in the same position in the three-dimensional space, and the mapping function can be used for the low-precision model. The mapping source is selected to the high-precision model, and the mapping framework is modified on the low-precision model with mapping so that all parts of the high-precision model are completely wrapped in the mapping framework. The low-precision model with mapping is further selected, and the baking function is used to draw the light and shadow information and color information rendered by the high-precision model onto the texture resource map of the preset material type formed by unfolding the low-precision model to obtain the light map and color map, and then the light map and color map are pasted back to the low-precision model. The texture resource map of the preset material type here is a map that has a good fit with the light and shadow information and color information. That is to say, the light map and color map formed after drawing the light and shadow information and color information have a good visual presentation effect. The light map and color map can be further stored as image materials for subsequent modification or use. At this time, the light map and color map inherit the rendering line information of the high-precision model, and the scene objects with modified details and highlights appear to have no sense of light source direction. The image material can also be copied into multiple applications to other locations.

[0128] It should be noted that using texture resource maps of different materials has different rendering effects. Here, before executing the baking function, you can set the texture map coordinate information of the low-precision model, and cut the low-precision model according to the texture map coordinate information and unfold it to obtain the texture resource map. The texture map coordinate information defines the position information of the points on the model surface and determines the position of the surface texture map. Further, different materials are added to the texture resource map to obtain texture resource maps of different material types. These maps represent different information of the low-precision model surface, mainly including reflection information, light and dark information, color information, etc. related to lighting. Here, two channels can be used to store the texture map coordinate information of the low-precision model. One channel stores the texture map coordinate information of the color information. The texture map coordinate information can overlap, and the other channel is used to store the texture map coordinate information of the light and shadow information. The texture map coordinate information cannot overlap. Specifically, you can set the texture map coordinate information of the low-precision model, use the texture map coordinate information as the drawing dividing line, divide the low-precision model into multiple patches, select the elements in the patch by editing the polygon, and unfold the selected elements to obtain the texture resource map.

[0129] 206. Transmit the low-precision model carrying the color map and the light map to a rendering engine, so that the rendering engine renders the low-precision model according to the color map and the light map.

[0130] It is understandable that since the lighting has no effect on the rendering of objects in static scenes, the static lighting information and color information are baked into light maps and color maps on the scene production side and then transmitted to the rendering engine. While omitting the normal map production step on the production side, the light maps and color maps can be viewed from multiple angles in the rendering engine without any problems, so that the rendering engine does not need to produce lighting effects and bake maps, nor does it need to perform real-time lighting calculations, thereby reducing the performance consumption of the virtual engine.

[0131] Furthermore, in order to facilitate rendering, the prepared low-precision model can be placed in the entire scene as required, and the entire scene can be imported into the rendering engine. At this time, the scene can only be modified on the production side. This modification method is more suitable for small application scenarios in educational applications. The scene layout is relatively fixed, and the scene quality can be improved through fewer scene modifications.

[0132] Furthermore, in order to reduce rendering batches, multiple approximate scene models in the scene can be bound into a merged scene model through an additional method. The approximate scene models are equivalent to objects of the same type and have the same properties, for example, objects of the same type as tree trunks and objects of the same type as stones. The merged scene model is then assigned a texture map coordinate information, baked into a map, and transmitted to the rendering engine for use.

[0133] The above embodiment describes the rendering process of the scene model on the client side of the scene production of the educational application. Furthermore, in order to fully illustrate the implementation of this embodiment, this embodiment also provides another scene model rendering method, which is applied to the client side running the educational application, such as Figure 4 As shown, the method includes:

[0134] 301. Receive a low-precision model carrying a color map and a light map, and read vector resource information in the low-precision model.

[0135] Specifically in the rendering engine, in addition to the color map and light map, the low-precision model also carries the relevant scene data required for model rendering. The rendering engine can render the scene model by reading the relevant scene data.

[0136] Here, the vector resource information is one of the related scene data that needs to be rendered, which includes different types of vector resources, such as normal vectors, light vectors, and view vectors. Specifically, the normal vector, light vector, and view vector of the low-precision model in the world space can be read separately, and the half-angle vector can be obtained by using the dot product of the view vector and the light vector, and then combined with the normal vector to form the vector resource information.

[0137] 302. Use the vector resource information to perform highlight control on the color map and the light map in a fragment shader, and use an interpolation function to calculate the highlight color information of each pixel.

[0138] Specifically, the normal vector and half-angle vector can be used to determine the highlight value, and the highlight value is used to adjust the intensity of the light map in the fragment shader and then superimposed on the color map to obtain the intensity range of the highlight color. Then, based on the intensity range of the highlight color, the interpolation function is used to calculate the highlight color information of each pixel.

[0139] In actual application, the highlight value determined by the normal vector and the half-angle vector can be used to set multiple controllers to control the light map using the highlight control module, and the adjusted light map can be superimposed on the color map to obtain the intensity range of the highlight color.

[0140] 303. Use the highlight color information to perform pixel filling on the low-precision model, and output a rendering result of the scene model.

[0141] It can be understood that the rendering process for the scene model here mainly includes the vertex shading part and the fragment shading part. In the vertex shading part, the vertex shader is mainly used to expand the low-precision model layer by layer, and the position of the scene object on the screen is drawn by drawing the texture resource information at each vertex position in the model. In the fragment shading part, the fragment shader is mainly used to fill the surface of the scene model, and the highlight is controlled by the light map and color map. The interpolation function is used to calculate the highlight color information of each pixel, and the highlight color information of each pixel is used to fill the pixel to control the scene model to have a better display effect.

[0142] Specifically, in the fragment shader, the normal vector, light vector and view vector of the low-precision model in the world space are obtained respectively, the dot product of the view vector and the light vector is used to obtain the half-angle vector, and the externally imported light map and color map are sampled. The built-in ambient color and color map in the rendering engine are multiplied to obtain a light map without shadow effects. The highlight value is obtained by dot product of the normal vector and the half-angle vector, and for the light map without shadow effects, the interpolation function is used to calculate the map value without shadow effects and the map value with shadow effects in the map, and then multiplied by the sampled light map, plus the previously sampled color map, and then controlled by the highlight value to obtain the final rendering result.

[0143] In actual applications, if the scene model needs to be reused in other scenes, you can set the corresponding position in the rendering engine and use the plug-in to export the scene model to the production end. After performing reasonable lighting baking on the scene model to form a texture resource, import it back into the rendering engine.

[0144] Further, as Figure 1-Figure 3 The specific implementation of the method, the embodiment of the present application provides a rendering device of a scene model, which is used in a terminal device for making educational applications, such as Figure 5 As shown, the device includes: a creation unit 41, a setting unit 42, a production unit 43, and a transmission unit 44.

[0145] The creation unit 41 can be used to create a low-precision model and a high-precision model of the scene object for the material in the static scene to be rendered;

[0146] The setting unit 42 may be used to set the environment information of the static scene to be rendered, and use the environment information to render the high-precision model to obtain light and shadow information and color information;

[0147] The production unit 43 may be configured to produce the low-precision model to align with the high-precision model, and to draw a color map and a light map using the light and shadow information and color information obtained by rendering the high-precision model, and transmit the color map and the light map to the low-precision model;

[0148] The transmission unit 44 may be configured to transmit the low-precision model carrying the color map and the light map to the rendering engine, so that the rendering engine renders the low-precision model according to the color map and the light map.

[0149] The rendering device of the scene model provided by the embodiment of the present invention, compared with the method in the current prior art that requires the addition of a large amount of material production process to render the scene model, the present application creates a low-precision model and a high-precision model of the scene object for the material in the static scene to be rendered, sets the environmental information in the static scene to be rendered, and uses the environmental information to render the high-precision model to obtain light and shadow information and color information. By making a low-precision model to align with the high-precision model, the light and shadow information and color information obtained by rendering the high-precision model are drawn into a color map and a light map, and passed to the low-precision model, so that the low-precision model has the lighting effect of the high-precision model, and further transmits the low-precision model carrying the color map and the light map to the rendering engine, so that the rendering engine renders the low-precision model according to the color map and the light map. The entire rendering process does not require the addition of normal maps and highlight maps, thereby avoiding the production process of a large amount of map materials in the scene, saving performance consumption on the rendering engine end to a certain extent, and reducing rendering batches.

[0150] In specific application scenarios, such as Figure 6 As shown, the creation unit 41 includes:

[0151] The first creation module 411 may be used to create a low-precision model of a scene object using an initial model as a prototype using a drawing command for a material in a static scene to be rendered;

[0152] The second creation module 412 may be configured to create a high-precision model of the scene object by performing edge and corner line addition and mesh smoothing processing on the low-precision model, so that the high-precision model has smoother corners than the low-precision model.

[0153] In specific application scenarios, such as Figure 6 As shown, the setting unit 42 includes:

[0154] The simulation module 421 can be used to simulate the lighting effect in the static scene to be rendered using light attribute parameters, and set the light and shadow parameters and color parameters assigned to the high-precision model;

[0155] The rendering module 422 can be used to render the high-precision model using the light and shadow parameters and color parameters to obtain light and shadow information and color information.

[0156] In specific application scenarios, such as Figure 6As shown, the production unit 43 includes:

[0157] A placement module 431 may be used to place the low-precision model and the high-precision model at the same position in a three-dimensional space;

[0158] The modification module 432 may be configured to use a mapping function for the low-precision model, select a mapping source to the high-precision model, and modify a mapping frame on the mapped low-precision model so that all parts of the high-precision model are completely enclosed in the mapping frame.

[0159] The drawing module 433 may be used to select the low-precision model with the mapping, and use a baking function to draw the light and shadow information and color information obtained by rendering the high-precision model onto a texture resource map of a preset material type formed by unfolding the low-precision model, thereby obtaining a light map and a color map.

[0160] The back pasting module 434 may be used to paste the light map and color map back to the low-precision model.

[0161] In specific application scenarios, such as Figure 6 As shown, the production unit 43 further includes:

[0162] The unfolding module 435 may be configured to, after selecting the low-precision model with the mapping, use a baking function to draw the light and shadow information and color information obtained by rendering the high-precision model onto the texture resource map unfolded by the low-precision model to form a light map and a color map, set the texture map coordinate information of the low-precision model, and then unfold the low-precision model according to the texture map coordinate information to obtain a texture resource map;

[0163] The adding module 436 can be used to add different materials to the texture resource map to obtain texture resource maps of different material types.

[0164] In a specific application scenario, the unfolding module 435 may be used to set texture mapping coordinate information of the low-precision model, and use the texture mapping coordinate information as a drawing dividing line to divide the low-precision model into a plurality of facets;

[0165] The unfolding module 435 can also be used to select elements in a patch by editing a polygon frame, and unfold the selected elements to obtain a texture resource map.

[0166] It should be noted that the other corresponding descriptions of the functional units involved in the rendering device of the scene model of the scene production end of the educational application provided in this embodiment can be referred to Figure 1-Figure 2 The corresponding description in will not be repeated here.

[0167] Further, as Figure 4 The specific implementation of the method, the embodiment of the present application provides a rendering device of a scene model, which is applied to a client running an educational application, such as Figure 7 As shown, the device includes: a reading unit 51, a control unit 52, and a rendering unit 53.

[0168] The reading unit 51 may be configured to receive a low-precision model carrying a color map and a light map, and read vector resource information from the low-precision model;

[0169] The control unit 52 may be configured to utilize the vector resource information to perform highlight control on the color map and the light map in a fragment shader, and calculate the highlight color information of each pixel using an interpolation function;

[0170] The rendering unit 53 may be configured to use the highlight color information to perform pixel filling on the low-precision model and output a rendering result of the scene model.

[0171] In a specific application scenario, the reading unit 51 can be specifically used to read the normal vector, light vector and view vector of the low-precision model in the world space respectively;

[0172] The reading unit 51 may be further configured to obtain a half-angle vector by using the dot product of the viewing angle vector and the light vector, and form vector resource information in combination with the normal vector.

[0173] In specific application scenarios, such as Figure 8 As shown, the control unit 52 includes:

[0174] A determination module 521 may be configured to determine a highlight value using the normal vector and the half-angle vector;

[0175] An adjustment module 522 may be configured to use the highlight value to adjust the intensity of the light map in a fragment shader and then superimpose the light map onto the color map to obtain an intensity range of the highlight color.

[0176] The calculation module 523 may be configured to calculate the highlight color information of each pixel using an interpolation function according to the intensity range of the highlight color.

[0177] It should be noted that for other corresponding descriptions of the functional units involved in the rendering device of the scene model provided in this embodiment, which can be applied to the rendering engine side, please refer to Figure 3 The corresponding description in will not be repeated here.

[0178] Based on the above Figure 1-Figure 3The method shown in FIG. 1 is a method for performing the above-mentioned operation. Accordingly, the embodiment of the present application further provides a storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned operation is performed. Figure 1-Figure 3 The rendering method of the scene model shown in FIG. Figure 4 The method shown in FIG. 1 is a method for performing the above-mentioned operation. Accordingly, the embodiment of the present application further provides a storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned operation is performed. Figure 4 The rendering method of the scene model shown.

[0179] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, USB flash drive, mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0180] Based on the above Figure 1-Figure 3 The method shown, and Figure 5-Figure 6 In order to achieve the above-mentioned purpose, the embodiment of the virtual device shown in the embodiment of the present application also provides a physical device for rendering a scene model, which can be a computer, a smart phone, a tablet computer, a smart watch, a server, or a network device, etc. The physical device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1-Figure 3 The rendering method of the scene model shown.

[0181] Based on the above Figure 4 The method shown, and Figure 7-Figure 8 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides another entity device for rendering a scene model, which can be a computer, a smart phone, a tablet computer, a smart watch, or a network device, etc. The entity device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 4 The rendering method of the scene model shown.

[0182] Optionally, the two physical devices described above may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a Wi-Fi module, and the like. The user interface may include a display, an input unit such as a keyboard, and the like. Optionally, the user interface may also include a USB interface, a card reader interface, and the like. The network interface may optionally include a standard wired interface, a wireless interface (such as a Wi-Fi interface), and the like.

[0183] In an exemplary embodiment, see Figure 9 The physical device includes a communication bus, a processor, a memory, and a communication interface. It may also include an input / output interface and a display device. The various functional units can communicate with each other via the bus. The memory stores a computer program, and the processor is configured to execute the program stored in the memory and perform the scene model rendering method described in the above embodiment.

[0184] Those skilled in the art will understand that the physical device structure for rendering a scene model provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different component arrangements.

[0185] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the physical device used to process store search information, supporting the execution of the information processing program and other software and / or programs. The network communication module is used to enable communication between components within the storage medium and with other hardware and software within the physical device used to process the information.

[0186] Through the description of the above implementation methods, those skilled in the art can clearly understand that this application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the technical solution of this application, compared with the current existing methods, the entire rendering process does not require the addition of normal maps and highlight maps, avoiding the production process of a large number of map materials in the scene, saving performance consumption on the rendering engine side to a certain extent, and reducing rendering batches.

[0187] Those skilled in the art will understand that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily required to implement the present application. Those skilled in the art will understand that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more devices different from the implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple sub-modules.

[0188] The serial numbers of the above application are for descriptive purposes only and do not represent the advantages or disadvantages of the implementation scenarios. The above disclosure only discloses several specific implementation scenarios of the present application, but the present application is not limited thereto. Any changes that can be conceived by those skilled in the art should fall within the scope of protection of the present application.

Claims

1. A method for rendering a scene model, characterized in that: Terminal devices used for developing educational applications include: Create low-precision models and high-precision models of scene objects for the materials in the static scene to be rendered; Setting environmental information in the static scene to be rendered, and rendering the high-precision model using the environmental information to obtain light and shadow information and color information; By making the low-precision model align with the high-precision model, the light and shadow information and color information obtained by rendering the high-precision model are drawn into a color map and a light map, and the light and shadow information and color information are passed to the low-precision model, specifically placing the low-precision model and the high-precision model at the same position in the three-dimensional space; using the mapping function for the low-precision model, selecting the mapping source to the high-precision model, and modifying the mapping framework on the low-precision model with the mapping so that all parts of the high-precision model are completely wrapped in the mapping framework; selecting the low-precision model with the mapping, and using the baking function to draw the light and shadow information and color information obtained by rendering the high-precision model onto a texture resource map of a preset material type formed by unfolding the low-precision model, to obtain a light map and a color map; pasting the light map and color map back to the low-precision model, the texture resource map of the preset material type being a map that has a fitting effect with the light and shadow information and color information; The low-precision model carrying the color map and the light map is transmitted to a rendering engine, so that the rendering engine renders the low-precision model according to the color map and the light map.

2. The method according to claim 1, characterized in that The step of creating a low-precision model and a high-precision model of the scene objects for the materials in the static scene to be rendered specifically includes: For the materials in the static scene to be rendered, use the drawing command to create a low-precision model of the scene object using the initial model as a prototype; A high-precision model of the scene object is created by performing edge and corner line addition and mesh smoothing processing on the low-precision model, so that the high-precision model has smoother corners than the low-precision model.

3. The method according to claim 1, characterized in that The step of setting the environmental information of the static scene to be rendered and rendering the high-precision model using the environmental information to obtain light and shadow information and color information specifically includes: Using light attribute parameters to simulate the lighting effect in the static scene to be rendered, and setting the light and shadow parameters and color parameters assigned to the high-precision model; The high-precision model is rendered using the light and shadow parameters and color parameters to obtain light and shadow information and color information.

4. The method according to claim 1, wherein Before selecting the low-precision model with the mapping and using the baking function to draw the light and shadow information and color information obtained by rendering the high-precision model onto a texture resource map of a preset material type formed by unfolding the low-precision model to obtain the light map and color map, the method further includes: Setting texture mapping coordinate information of the low-precision model, and cutting and unfolding the low-precision model according to the texture mapping coordinate information to obtain a texture resource map; Different materials are added to the texture resource map to obtain texture resource maps of different material types.

5. The method according to claim 4, characterized in that The step of setting the texture map coordinate information of the low-precision model and cutting and unfolding the low-precision model according to the texture map coordinate information to obtain a texture resource map specifically includes: Setting texture mapping coordinate information of the low-precision model, using the texture mapping coordinate information as a drawing segmentation line, and dividing the low-precision model into a plurality of facets; Select the elements in the patch by editing the polygon box, and expand the selected elements to obtain the texture resource map.

6. A method for rendering a scene model, characterized in that: Applicable to clients running educational applications, including: A low-precision model carrying a color map and a light map is received, and vector resource information in the low-precision model is read. The specific process of generating the low-precision model is as follows: the low-precision model and the high-precision model are placed at the same position in three-dimensional space; a mapping function is used for the low-precision model, a mapping source is selected to the high-precision model, and a mapping framework is modified on the low-precision model with the mapping so that all parts of the high-precision model are completely wrapped in the mapping framework; the low-precision model with the mapping is selected, and a baking function is used to draw the light and shadow information and color information rendered by the high-precision model onto a texture resource map of a preset material type formed by unfolding the low-precision model to obtain a light map and a color map; the light map and color map are pasted back to the low-precision model, and the texture resource map of the preset material type is a map that has a fitting effect with the light and shadow information and color information; Using the vector resource information, performing highlight control on the color map and the light map in a fragment shader, and using an interpolation function to calculate highlight color information for each pixel; The low-precision model is pixel-filled using the highlight color information, and a rendering result of the scene model is output.

7. The method according to claim 6, characterized in that The reading of the vector resource information in the low-precision model specifically includes: Respectively read the normal vector, light vector and view vector of the low-precision model in the world space; A half-angle vector is obtained by taking the dot product of the viewing angle vector and the light vector, and is combined with the normal vector to form vector resource information.

8. The method according to claim 7, characterized in that The utilizing the vector resource information to perform highlight control on the color map and the light map in the fragment shader, and using an interpolation function to calculate the highlight color information of each pixel, specifically includes: Determine a highlight value using the normal vector and the half-angle vector; Using the highlight value to adjust the intensity of the light map in the fragment shader and then superimposing it on the color map to obtain an intensity range of the highlight color; An interpolation function is used to calculate the highlight color information of each pixel according to the intensity range of the highlight color.

9. A rendering device for a scene model, characterized in that: Terminal devices used for developing educational applications include: A creation unit, configured to create a low-precision model and a high-precision model of scene objects respectively for materials in a static scene to be rendered; A setting unit, configured to set environmental information in the static scene to be rendered, and render the high-precision model using the environmental information to obtain light and shadow information and color information; A production unit is configured to produce the low-precision model so as to align the high-precision model, and transmit a color map and a light map drawn from the light and shadow information and color information obtained by rendering the high-precision model to the low-precision model, specifically placing the low-precision model and the high-precision model at the same position in three-dimensional space; using a mapping function for the low-precision model, selecting a mapping source to the high-precision model, and modifying a mapping framework on the mapped low-precision model so that all parts of the high-precision model are completely wrapped in the mapping framework; selecting the mapped low-precision model, and using a baking function to draw the light and shadow information and color information obtained by rendering the high-precision model onto a texture resource map of a preset material type formed by unfolding the low-precision model, to obtain a light map and a color map; and pasting the light map and the color map back to the low-precision model, wherein the texture resource map of the preset material type is a map that has a fitting effect with the light and shadow information and the color information; A transmission unit is used to transmit the low-precision model carrying the color map and the light map to a rendering engine, so that the rendering engine renders the low-precision model according to the color map and the light map.

10. A rendering device for a scene model, characterized in that: The client used to run educational applications includes: A reading unit is used to receive a low-precision model carrying a color map and a light map, and read the vector resource information in the low-precision model. The specific process of generating the low-precision model is as follows: placing the low-precision model and the high-precision model at the same position in three-dimensional space; using a mapping function for the low-precision model, selecting the mapping source to the high-precision model, and modifying the mapping framework on the low-precision model with the mapping so that all parts of the high-precision model are completely wrapped in the mapping framework; selecting the low-precision model with the mapping, and using a baking function to draw the light and shadow information and color information rendered by the high-precision model onto a texture resource map of a preset material type formed by unfolding the low-precision model, to obtain a light map and a color map; pasting the light map and color map back to the low-precision model, where the texture resource map of the preset material type is a map that has a fitting effect with the light and shadow information and color information; A control unit, configured to utilize the vector resource information to perform highlight control on the color map and the light map in a fragment shader, and to calculate highlight color information of each pixel using an interpolation function; A rendering unit is used to use the highlight color information to fill pixels of the low-precision model and output a rendering result of the scene model.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the scene model rendering method according to any one of claims 1 to 8 are implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the scene model rendering method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Micro-structure surface global lighting drawing method based on direction light radiation intensity

    CN104167011A

  • Model rendering method, device and equipment

    CN112116692A