Method and device for rendering virtual model in game, program product and electronic equipment

By automatically obtaining the map templates and channel data of the virtual model, the problems of low rendering efficiency and inconsistent effects of virtual models in the existing technology are solved, and efficient and unified rendering effects are achieved.

CN119417963APending Publication Date: 2025-02-11NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411455046.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

In the prior art, rendering of virtual models requires manual setup of channel data, resulting in high labor and time costs, low rendering efficiency, and difficult to unify the effect.

Method used

By determining the material type information of the virtual model, selecting the appropriate texture template from the preset texture template library, sampling the texture template using the sampling coordinates, obtaining channel data, and rendering the target points based on the channel data and material type information.

Benefits of technology

It reduces the labor and time cost in the virtual model rendering process, improves rendering efficiency, ensures consistency of rendering effects, and improves the flexibility and diversity of the rendering process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119417963A_ABST
    Figure CN119417963A_ABST
Patent Text Reader

Abstract

The invention provides a rendering method and device of a virtual model in a game, a program product and electronic equipment, and relates to the technical field of computers. The method comprises the following steps: determining a to-be-rendered virtual model from virtual models, and determining material type information of the to-be-rendered virtual model; selecting a first map template from a preset map template library in combination with display demand information and material type information of the to-be-rendered virtual model; determining a target point in the to-be-rendered virtual model, and determining a sampling coordinate of the target point according to the size data of the to-be-rendered virtual model and the size data of the first mapping template; sampling the first mapping template by using the sampling coordinates to obtain channel data corresponding to each channel of the target point; and based on the channel data and a preset material map associated with the material type information, rendering the target point, so that the rendered to-be-rendered virtual model meets the display demand information. The model rendering efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method for rendering a virtual model in a game, a device for rendering a virtual model in a game, a computer program product, and an electronic device. Background Art

[0002] Virtual models are often used in film, television, games, animation and other fields. By rendering the models, realistic and artistic visual effects can be presented.

[0003] In the related art, workers are usually required to manually set channel data based on experience to achieve the rendering of virtual models. Obviously, this method requires high manpower and time costs, and the model rendering effect is difficult to unify, resulting in low efficiency of virtual model rendering. Summary of the invention

[0004] The present disclosure provides a method for rendering a virtual model in a game, a device for rendering a virtual model in a game, a computer program product, and an electronic device, thereby improving the problem of low model rendering efficiency at least to a certain extent.

[0005] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0006] According to a first aspect of the present disclosure, a method for rendering a virtual model in a game is provided, comprising: determining a virtual model to be rendered from the virtual model, and determining material type information of the virtual model to be rendered; selecting a first texture template from a preset texture template library in combination with display requirement information of the virtual model to be rendered and the material type information, wherein the texture template library stores a plurality of texture templates, each of the texture templates is used to obtain channel data, and the channel data is used to mix preset material textures; determining a target point in the virtual model to be rendered, and determining sampling coordinates of the target point according to size data of the virtual model to be rendered and size data of the first texture template; sampling the first texture template using the sampling coordinates to obtain channel data corresponding to the target point in each channel; rendering the target point based on the channel data and the preset material texture associated with the material type information, so that the rendered virtual model to be rendered meets the display requirement information.

[0007] According to a second aspect of the present disclosure, a rendering device for a virtual model in a game is provided, characterized in that it includes: an information acquisition module, configured to determine a virtual model to be rendered from the virtual model, and determine the material type information of the virtual model to be rendered; a first texture template selection module, configured to select a first texture template from a preset texture template library in combination with the display requirement information of the virtual model to be rendered and the material type information, wherein the texture template library stores a plurality of texture templates, each of which is used to obtain channel data, and the channel data is used to mix preset material textures; a sampling coordinate determination module, configured to determine a target point in the virtual model to be rendered, and determine the sampling coordinates of the target point according to the size data of the virtual model to be rendered and the size data of the first texture template; a channel data acquisition module, configured to sample the first texture template using the sampling coordinates to obtain the channel data corresponding to the target point in each channel; and a channel data use module, configured to render the target point based on the channel data and the preset material texture associated with the material type information, so that the rendered virtual model to be rendered meets the display requirement information.

[0008] According to a third aspect of the present disclosure, a computer program is provided, which, when executed by a processor, implements the method for rendering a virtual model in a game according to the first aspect and possible implementation thereof.

[0009] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor, wherein the processor is configured to execute the method for rendering a virtual model in a game and possible implementation thereof of the first aspect by executing the executable instructions.

[0010] The technical solution disclosed in this disclosure has the following beneficial effects:

[0011] On the one hand, based on the material type information of the virtual model to be rendered, the first texture template is selected from the preset texture template library, and the sampling coordinates are obtained through the target point of the virtual model to be rendered, and the first texture template is sampled to obtain channel data, so as to render the target point based on the channel data; compared with the method of manually setting the channel data to render the virtual model in the prior art, the first texture template of the virtual model to be rendered is obtained, and the channel data of the target point is automatically obtained in the first texture template to render the virtual model, which reduces the labor cost and time cost in the process of rendering the virtual model and improves the model rendering efficiency. On the other hand, after determining the first texture template, the target point is rendered based on the channel data, which effectively avoids the problem of inconsistent visual effects caused by manual setting of channel data, so that the artistic expression effect of the virtual model after rendering is consistent. On the other hand, if the display effect of the virtual model needs to be changed, it is only necessary to replace the first texture template, without adjusting the channel data of the virtual model through a large number of repeated manual operations, thereby effectively improving the flexibility and diversity of the virtual model rendering process and accelerating the iteration rate of the display effect of the virtual model.

[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0014] Figure 1 The system operation architecture of this exemplary embodiment is shown;

[0015] Figure 2 A flowchart showing a method for rendering a virtual model in a game in this exemplary embodiment;

[0016] Figure 3 A schematic diagram showing a first mapping template in this exemplary embodiment;

[0017] Figure 4 A schematic diagram showing a virtual model to be rendered including a plurality of areas to be processed in this exemplary embodiment;

[0018] Figure 5 A flowchart showing a process of determining sampling coordinates in this exemplary embodiment;

[0019] Figure 6 A schematic diagram showing a road extension direction of a road model to be rendered in this exemplary embodiment;

[0020] Figure 7 A flowchart showing a process of rendering a target point in this exemplary embodiment is shown;

[0021] Figure 8 A schematic diagram showing a rendered virtual model to be rendered in this exemplary embodiment;

[0022] Fig. 9 A schematic diagram showing the structure of a rendering device for a virtual model in a game according to the exemplary embodiment;

[0023] Fig.10 A schematic structural diagram of an electronic device in this exemplary embodiment is shown. DETAILED DESCRIPTION

[0024] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0025] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0026] In the related art, workers are usually required to manually set channel data based on experience to achieve the rendering of virtual models. For example, in Unreal Engine or Digital Content Creation (DCC) software, channel data is manually drawn to achieve the rendering of virtual models. Obviously, this method requires high manpower and time costs, and the model rendering effect is difficult to unify, resulting in low efficiency in virtual model rendering.

[0027] The exemplary embodiment of the present disclosure first provides a method for rendering a virtual model in a game. Figure 1 The system architecture of the operating environment of this exemplary embodiment will be described.

[0028] refer to Figure 1 As shown, the system architecture 100 may include a terminal device 110 and a server 120. The terminal device 110 may be an electronic device such as a tablet computer, a laptop computer, or a desktop computer, and the terminal device 110 may be used to obtain a texture template library corresponding to the type of the virtual model to be rendered.

[0029] The method for rendering a virtual model in a game of this exemplary embodiment may be executed by the terminal device 110. For example, in a game scene, the terminal device 110 may be a computer for a staff member to generate a virtual model in the game scene, and the first texture template may be selected from a preset texture template library in combination with display requirement information and material type information of the virtual model to be rendered. The terminal device 110 selects a target point in the virtual model to be rendered by executing the method for rendering a virtual model in the game, determines the sampling coordinates of the target point, and renders the target point using the channel data obtained by sampling the first texture template using the sampling coordinates, and the preset material texture associated with the material type information, and displays the rendered virtual model to be rendered to the staff member.

[0030] It can be seen from the above that the method for rendering a virtual model in a game in this exemplary embodiment can be executed by the above-mentioned terminal device 110.

[0031] Combine the following Figure 2 The method of rendering virtual models in games is described. Figure 2 An exemplary process of a method for rendering a virtual model in a game is shown, comprising the following steps S210 to S250:

[0032] Step S210, determining a virtual model to be rendered from the virtual models, and determining material type information of the virtual model to be rendered;

[0033] Step S220, combining the display requirement information and material type information of the virtual model to be rendered, selecting a first texture template from a preset texture template library, wherein the texture template library stores multiple texture templates, each texture template is used to obtain channel data, and the channel data is used to mix the preset material texture;

[0034] Step S230, determining a target point in the virtual model to be rendered, and determining a sampling coordinate of the target point according to the size data of the virtual model to be rendered and the size data of the first mapping template;

[0035] Step S240, sampling the first mapping template using the sampling coordinates to obtain channel data corresponding to the target point in each channel;

[0036] Step S250, rendering the target point based on the channel data and the preset material map associated with the material type information, so that the rendered virtual model to be rendered meets the display requirement information.

[0037] Based on the above method, on the one hand, based on the material type information of the virtual model to be rendered, the first texture template is selected from the preset texture template library, and the sampling coordinates are obtained through the target point of the virtual model to be rendered, and the first texture template is sampled to obtain channel data, so as to render the target point based on the channel data; compared with the method of manually setting the channel data to render the virtual model in the prior art, the first texture template of the virtual model to be rendered is obtained, and the channel data of the target point is automatically obtained in the first texture template to render the virtual model, which reduces the labor cost and time cost in the process of rendering the virtual model and improves the model rendering efficiency. On the other hand, after determining the first texture template, the target point is rendered based on the channel data, which effectively avoids the problem of inconsistent visual effects caused by manual setting of channel data, so that the artistic expression effect of the virtual model after rendering is consistent. On the other hand, if the display effect of the virtual model needs to be changed, it is only necessary to replace the first texture template, without adjusting the channel data of the virtual model through a large number of repeated manual operations, thereby effectively improving the flexibility and diversity of the virtual model rendering process and accelerating the iteration rate of the display effect of the virtual model.

[0038] Below Figure 2 Each step in the procedure is described in detail.

[0039] refer to Figure 2 In step S210, a virtual model to be rendered is determined from the virtual models, and material type information of the virtual model to be rendered is determined.

[0040] The virtual model to be rendered may include a virtual model that needs to be rendered or a virtual model that needs to adjust the display effect. For example, the virtual model to be rendered may include a road model to be rendered. The material type information may be used to characterize the type of material used by the virtual model to be rendered. For example, the virtual model to be rendered may include a road model, and the road model may use two materials in different areas: soil material and cement material. The material type information of the road model may include identification information of the soil material and identification information of the cement material. At the same time, the preset material map associated with the material type information may generate the corresponding material after superposition.

[0041] It should be noted that, since the same virtual model to be rendered may include only one material or may be composed of multiple materials, correspondingly, the material type information of the same virtual model to be rendered may include one or more materials, and the present disclosure does not make any special limitation on this.

[0042] Continue to refer Figure 2 In step S220, the first texture template is selected from a preset texture template library in combination with the display requirement information and material type information of the virtual model to be rendered, wherein the texture template library stores multiple texture templates, each texture template is used to obtain channel data, and the channel data is used to mix the preset material texture.

[0043] The display requirement information may include information related to the display effect of the virtual model to be rendered, for example, it may include information such as special requirements of the staff for the display effect of the virtual model to be rendered. The texture template library may be a container for storing preset texture templates, for example, the texture template library may be a database for storing texture templates; for example, the texture template may refer to Figure 3 As shown, through Figure 3 The texture template shown in the figure performs color sampling, and the color channel value of the sampling point in the texture template can be obtained. For example, the value of the four color channels of red (Red, R), green (Green, G), blue (Blue, B), and transparency (Alpha, A) of the corresponding point in the texture template can be obtained by sampling the texture template to determine the vertex color of the sampling point, thereby obtaining the channel data; therefore, the texture template can be an image containing RGB colors or RGBA colors.

[0044] It should be noted that the above-mentioned mapping templates can be pre-made in advance by artists according to the type of virtual models; or a script can be designed to realize the process of automatically generating mapping templates. The script can automatically generate images with RGB or RGBA colors according to the type of virtual model, thereby obtaining the mapping template, wherein the type of virtual model can be used to determine the shape of the mapping template; the present disclosure does not make any special limitation on this.

[0045] In one implementation, before obtaining a texture template library corresponding to the type of the virtual model to be rendered, a texture template library may be established according to the type of the virtual model to be rendered.

[0046] That is to say, the texture templates available for the same type of virtual models to be rendered can be stored in the same container to obtain a texture template library; for example, the types of virtual models to be rendered may include roads, walls, etc., and texture templates for multiple road models can be pre-made and stored in the same database to obtain a texture template library for road models; further, in the texture template library, the texture templates can be subdivided according to the material type of the virtual model to be rendered. For example, the material type of the road model to be rendered may include cement material, soil material, etc. Road models of different material types have different appearances, and different texture templates need to be used to obtain channel data. Therefore, in the texture template library of the road model, the texture templates can be further classified according to the material type of the road model, so as to quickly locate the texture template with available material type information, thereby selecting the first texture template.

[0047] The above method of establishing a texture template library according to the type of virtual model can accelerate the acquisition process of the first texture template, thereby facilitating improving the rendering efficiency of the virtual model.

[0048] Since different areas in the same model to be rendered may use different materials, in one embodiment, the virtual model to be rendered may include one or more areas to be processed; and determining the material type information of the virtual model to be rendered may include: determining the material type information of each area to be processed respectively;

[0049] The above-mentioned selecting the first texture template from the preset texture template library by combining the display requirement information and the material type information of the virtual model to be rendered may include the following steps:

[0050] In the texture template library, a texture template associated with the material type information is selected to be determined as a candidate texture template corresponding to the area to be processed;

[0051] Based on the display requirement information, a first mapping template of the area to be processed is determined from the candidate mapping templates.

[0052] That is to say, different areas of the same virtual model to be rendered may use different first texture templates due to different material types. Therefore, the first texture template selected from the texture template library may be one or more.

[0053] For example, material type information can be set for the area to be processed in the rendered virtual model, and the first texture template can be selected from the texture template library by automatically identifying the material type information of each area to be processed; or the developer can manually select the first texture template based on the material type information of the area to be processed.

[0054] Acquiring the first mapping templates corresponding to different to-be-processed areas through material type information can meet the requirement of rendering different display effects in the same to-be-rendered virtual model, thereby improving the authenticity and richness of the to-be-rendered virtual model.

[0055] Continue to refer Figure 2 In step S230, a target point is determined in the virtual model to be rendered, and a sampling coordinate of the target point is determined according to the size data of the virtual model to be rendered and the size data of the first mapping template.

[0056] The virtual model to be rendered includes a plurality of model vertices, and the target point may be a model vertex of the virtual model to be rendered, or may include a point manually selected by a staff member in the virtual model to be rendered. The size data may include data describing the size of the texture template or the virtual model, for example, the length and width of the texture template or the virtual model.

[0057] In one embodiment, after determining the target point in the virtual model to be rendered, the method may further include:

[0058] Acquire a target area to be processed where the target point is located in the virtual model to be rendered, and a first mapping template corresponding to the target area to be processed;

[0059] The above-mentioned determining the sampling coordinates of the target point according to the size data of the virtual model to be rendered and the size data of the first mapping template may include:

[0060] The sampling coordinates of the target point are determined according to the size data of the target area to be processed and the size data of the first mapping template corresponding to the target area to be processed.

[0061] That is to say, when there are multiple first mapping templates corresponding to the virtual model to be rendered, it is necessary to jointly determine the sampling coordinates of the target point based on the size data of the area to be processed where the target point is located, and the size data of the first mapping template corresponding to the area to be processed; when the virtual model to be rendered corresponds to one first mapping template, the sampling coordinates of the target point can be determined based on the size data of the virtual model to be rendered and the size data of the first mapping template.

[0062] For example, refer to Figure 4 As shown, Figure 4The virtual model to be rendered shown belongs to a road model, in which the area to be processed 420 is made of cement material, and the areas to be processed 411 and 412 are made of soil material. Since the areas to be processed 411 and 412 use the same material and the area to be processed 420 uses another material, the area to be processed 420 corresponds to a first mapping template, and the areas to be processed 411 and 412 correspond to another first mapping template; if the target point exists in the area to be processed 420, the sampling coordinates of the target point can be determined based on the size data of the area to be processed 420 and the size data of the first mapping template corresponding to it.

[0063] By determining the sampling coordinates of the target point using the size data of the area to be processed and the size data of the first mapping template, the accuracy of the sampling coordinates can be improved, thereby accurately obtaining the channel data of the target point in the subsequent process, further improving the visual effect of the rendered virtual model.

[0064] In one embodiment, the sampling coordinates of the target point are determined according to the size data of the virtual model to be rendered and the size data of the first texture template. Figure 5 As shown, steps S510 to S530 may be included:

[0065] Step S510, calculating the ratio of the size data of the virtual model to be rendered to the size data of the first mapping template;

[0066] Step S520, determining the number of tiling times of the first texture template on the virtual model to be rendered according to the ratio;

[0067] Step S530 , when the number of tiling times is greater than 1, scaling the preset coordinates of the target point using the number of tiling times as a scaling ratio, so as to determine the preset coordinates after the scaling processing as the sampling coordinates of the target point.

[0068] Among them, the preset coordinates can be coordinates set based on the position of the target point in the virtual model to be rendered. The present disclosure does not specifically limit the method for obtaining the preset coordinates. Exemplarily, the preset coordinates of the target point can be UV coordinates manually set by a staff member. The original coordinates of the target point can also be uniformly processed by a data preprocessing method to obtain the preset coordinates. For example, the data preprocessing method can include normalization processing and the like.

[0069] For example, the width tx and length ty of the first texture template can be obtained by the resolution of the first texture template to obtain the size data of the first texture template; and the width rx and the road length ry of the virtual model to be rendered are obtained, and the tiling times ratio are calculated according to the following formula:

[0070] ratio = (ry / rx) / (ty / tx)

[0071] When the ratio is greater than 1, the preset coordinates of the target point are scaled by the ratio to obtain the sampling coordinates of the target point.

[0072] based on Figure 5 The method can scale the preset coordinates of the target point by the number of tiling times of the first texture template on the virtual model to be rendered, so that the obtained sampling coordinates are the corresponding coordinates of the preset coordinates of the target point in the first texture template, providing the possibility for sampling channel data in the first texture template.

[0073] In one embodiment, the virtual model to be rendered includes a road model to be rendered; the preset coordinates include a first coordinate value and a second coordinate value, the first coordinate value is a coordinate value along the road extension direction of the road model to be rendered, and the second coordinate value is a coordinate value perpendicular to the road extension direction.

[0074] For example, refer to Figure 6 As shown, 610 can be the above-mentioned road model to be rendered. The figure shows the road extension direction of 610 and the direction perpendicular to the road extension direction; if the preset coordinates of the road model to be rendered are UV coordinates, the first coordinate value can be set to be the coordinate value on the y-axis in the UV coordinate system, that is, the coordinate axis direction of the y-axis is the same as the road extension direction of the road model to be rendered; and the second coordinate value is set to be the coordinate value on the x-axis in the UV coordinate system, that is, the coordinate axis direction of the x-axis is perpendicular to the road extension direction of the road model to be rendered.

[0075] The above-mentioned scaling process of the preset coordinates of the target point by using the number of tiling times as the scaling ratio may include the following steps:

[0076] Determine a corresponding numerical interval of the first coordinate value in the sampling coordinates based on the number of tiling times;

[0077] The first coordinate value is mapped to a numerical interval to perform scaling processing on the first coordinate value.

[0078] The scaling process for the second coordinate value may include:

[0079] The second coordinate value is scaled using a preset scaling ratio.

[0080] That is to say, if the virtual model to be rendered includes a road model to be rendered, the scaling ratios corresponding to the coordinate values ​​in different directions may be different. In the above method, the number of tiling times is used as the scaling ratio for the first coordinate value of the target point, and the second coordinate value is scaled using a preset scaling ratio; wherein the preset scaling ratio is used to scale the second coordinate value and can be set by the staff. The present disclosure does not specifically limit the specific value of the preset scaling ratio.

[0081] It should be noted that the preset zoom ratio can be the same as the number of tiling times or different from the number of tiling times. When the preset zoom ratio is 1, the second coordinate value needs to be normalized so that the first mapping template completely covers the road model to be rendered in the direction perpendicular to the road extension direction.

[0082] For example, the preset coordinates of the target point in the road model to be rendered can be represented by uv1, and the sampling coordinates corresponding to the target point can be obtained by uv2 according to the following code:

[0083] uv2=(fit(uv1.x,min.x,max.x,0,1),fit(uv1.y,min.y,max.y,0,ratio));

[0084] Among them, fit(uv1.x,min.x,max.x,0,1) is used to normalize the second coordinate value, uv1.x represents the specific value of the second coordinate value of the target point obtained, and "min.x,max.x,0,1" is used to determine the numerical interval of the second coordinate value in uv2. In the above code, the numerical interval of the second coordinate value in uv2 is [0,1], that is, the preset scaling ratio of the second coordinate value is 1, and the preset scaling ratio can be modified by modifying "0,1";

[0085] fit(uv1.y,min.y,max.y,0,ratio) is used to scale the first coordinate value, where uv1.y represents the specific value of the first coordinate value of the target point obtained. By setting the maximum value max.y of uv1.y as the tiling number ratio, the first coordinate value is scaled using the tiling number as the scaling ratio. The first coordinate value of the target point is scaled according to the tiling number, and the second coordinate value is normalized. This can achieve the effect that the first mapping template is tiled in the road extension direction in the road model to be rendered, and completely covers the road model to be rendered in the direction perpendicular to the road extension direction.

[0086] By setting the scaling ratio of the road model to be rendered in the road extension direction and in the direction perpendicular to the road extension direction, the display effects of various road models can be achieved, thereby improving the richness and diversity of the road models.

[0087] Continue to refer Figure 2 In step S240, the first mapping template is sampled using the sampling coordinates to obtain channel data corresponding to the target point in each channel; and in step S250, the target point is rendered based on the channel data and the preset material map associated with the material type information, so that the rendered virtual model meets the display requirement information.

[0088] In one embodiment, the preset material map associated with the channel data and material type information is used to render the target point. Figure 7 As shown, steps S710 to S730 may be included:

[0089] Step S710, obtaining original texture information of the target point in each preset material map; each preset material map is stored in a different layer of the virtual model to be rendered;

[0090] Step S720, determining a layer to be mixed corresponding to any channel data based on a preset texture mixing rule;

[0091] Step S730, mixing the original texture information in the to-be-mixed layer according to any channel data to render the target point.

[0092] That is to say, the channel data of the target point can be obtained through the channel data and the preset texture mixing rules, so that the channel data of the target point can be used to mix the original texture information of the target point in multiple layers, so as to achieve the rendering of the target point. Among them, the preset texture mixing rules are used to indicate the correspondence between channel data and layers; exemplarily, if the virtual model to be rendered includes four layers layer1 to layer4, wherein layer1 is used to store the original texture of the virtual model to be rendered, that is, the texture before the channel data is superimposed, then the preset texture mixing rules can be: superimpose layer1 and layer2 through the channel data of the R color channel, superimpose layer2 and layer3 through the channel data of the G color channel, and superimpose layer3 and layer4 through the channel data of the B color channel.

[0093] For example, after obtaining the sampling coordinate uv2, the channel data obtained by sampling the first texture template with the sampling coordinate uv2 can be obtained by the following code:

[0094] v@Cd=rawcolormap(s@Shader_Vertex_Color_C,v@uv2);

[0095] Among them, v@Cd is used to store the channel data obtained by sampling, the rawcolormap() function can realize the process of sampling the first texture template according to the sampling coordinates, s@Shader_Vertex_Color_C represents the first texture template, and v@uv2 represents the sampling coordinates are uv2;

[0096] The virtual model to be rendered may include four layers layer1 to layer4, then the original texture information of the target point may include the texture information of the target point in layers layer1 to layer4, according to the above-mentioned preset map mixing rule; after obtaining the channel data of the target point, the original texture information of the target point in layer1 and layer2 may be superimposed by the channel data of the R color channel, the original texture information of the target point in layer2 and layer3 may be superimposed by the channel data of the G color channel, and the original texture information of the target point in layer3 and layer4 may be superimposed by the channel data of the B color channel, so as to adjust the display effect of the target point, thereby realizing the rendering of the target point, refer to Figure 8 As shown, the virtual model to be rendered before rendering is shown as 810, the first mapping template is shown as 820, and the virtual model to be rendered obtained by superimposing the first mapping template on the target point in the virtual model to be rendered is shown as 830.

[0097] based on Figure 7 The method can uniformly follow the preset map mixing rules and use the channel data of the target point to mix the original texture information of the target point in each layer to achieve the rendering of the target point, effectively avoiding the problem of inconsistent visual effects caused by errors in manually setting channel data, so that the artistic expression effect of the virtual model after rendering is consistent.

[0098] Based on the above method, the channel data of the target point can be automatically acquired, and the virtual model can be rendered based on the channel data; the labor cost and time cost in the process of rendering the virtual model are reduced, and the model rendering efficiency is improved.

[0099] The exemplary embodiment of the present disclosure also provides a rendering device for a virtual model in a game. Fig. 9 As shown, the rendering device 900 of the virtual model in the game may include:

[0100] The information acquisition module 910 is configured to determine a virtual model to be rendered from the virtual models, and determine material type information of the virtual model to be rendered;

[0101] The first texture template selection module 920 is configured to select a first texture template from a preset texture template library in combination with display requirement information and material type information of the virtual model to be rendered, wherein the texture template library stores multiple texture templates, each texture template is used to obtain channel data, and the channel data is used to mix the preset material texture;

[0102] The sampling coordinate determination module 930 is configured to determine a target point in the virtual model to be rendered, and determine the sampling coordinates of the target point according to the size data of the virtual model to be rendered and the size data of the first mapping template;

[0103] The channel data acquisition module 940 is configured to sample the first mapping template using the sampling coordinates to obtain the channel data corresponding to the target point in each channel;

[0104] The channel data using module 950 is configured to render the target point based on the channel data and the preset material map associated with the material type information, so that the rendered virtual model to be rendered meets the display requirement information.

[0105] In one implementation, the virtual model to be rendered includes a plurality of areas to be processed; and determining the material type information of the virtual model to be rendered may include:

[0106] Determine the material type information of each area to be processed.

[0107] In one embodiment, the above-mentioned selecting the first texture template from a preset texture template library in combination with the display requirement information and the material type information of the virtual model to be rendered may include:

[0108] In the texture template library, a texture template associated with the material type information is selected to be determined as a candidate texture template corresponding to the area to be processed;

[0109] Based on the display requirement information, a first mapping template of the area to be processed is determined from the candidate mapping templates.

[0110] In one embodiment, after determining the target point in the virtual model to be rendered, the apparatus may further include:

[0111] Acquire a target area to be processed where the target point is located in the virtual model to be rendered, and a first mapping template corresponding to the target area to be processed;

[0112] Determining the sampling coordinates of the target point according to the size data of the virtual model to be rendered and the size data of the first mapping template includes:

[0113] The sampling coordinates of the target point are determined according to the size data of the target area to be processed and the size data of the first mapping template corresponding to the target area to be processed.

[0114] In one implementation, the above-mentioned rendering of the target point based on the preset material map associated with the channel data and the material type information may include:

[0115] Obtaining original texture information of the target point in each preset material map; each preset material map is stored in a different layer of the virtual model to be rendered;

[0116] Based on the preset texture mixing rules, determine the layer to be mixed corresponding to any channel data;

[0117] The original texture information in the to-be-mixed layer is mixed according to any channel data to render the target point.

[0118] In one embodiment, determining the sampling coordinates of the target point according to the size data of the virtual model to be rendered and the size data of the first texture template may include:

[0119] Calculating the ratio of the size data of the virtual model to be rendered to the size data of the first mapping template;

[0120] Determine the number of times the first texture template is tiled on the virtual model to be rendered according to the ratio;

[0121] When the number of tiling times is greater than 1, the preset coordinates of the target point are scaled using the number of tiling times as a scaling ratio, so that the preset coordinates after the scaling processing are determined as the sampling coordinates of the target point.

[0122] In one embodiment, the virtual model to be rendered includes a road model to be rendered; the preset coordinates include a first coordinate value and a second coordinate value, the first coordinate value is a coordinate value along the road extension direction of the road model to be rendered, and the second coordinate value is a coordinate value perpendicular to the road extension direction.

[0123] In one implementation, the scaling process of the preset coordinates of the target point using the number of tiling times as the scaling ratio may include:

[0124] Determine a corresponding numerical interval of the first coordinate value in the sampling coordinates based on the number of tiling times;

[0125] The first coordinate value is mapped to a numerical interval to perform scaling processing on the first coordinate value.

[0126] In one embodiment, the above device may further include:

[0127] The second coordinate value is scaled using a preset scaling ratio.

[0128] The specific details of each part of the above device have been described in detail in the implementation method part, so they will not be repeated here.

[0129] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0130] The exemplary embodiments of the present disclosure further provide a computer program product, the computer program product comprising a computer program, and the computer program implements the above rendering method when executed by a processor.

[0131] Computer programs for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The computer program may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0132] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.

[0133] The code of the computer program can be written in one or more programming languages. Programming languages ​​such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).

[0134] Computer programs can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared, etc. Electronic devices can convert signals carrying computer programs into digital signals and then run the computer programs. When the computer program is executed on an electronic device, its code is used to enable the electronic device to execute (more specifically, to enable the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned rendering method, which includes the following steps: determining a virtual model to be rendered from a virtual model, and determining the material type information of the virtual model to be rendered; selecting a first texture template from a preset texture template library in combination with the display requirement information and the material type information of the virtual model to be rendered, wherein the texture template library stores multiple texture templates, each texture template is used to obtain channel data, and the channel data is used to mix the preset material texture; determining a target point in the virtual model to be rendered, and determining the sampling coordinates of the target point according to the size data of the virtual model to be rendered and the size data of the first texture template; sampling the first texture template using the sampling coordinates to obtain the channel data corresponding to the target point in each channel; rendering the target point based on the channel data and the preset material texture associated with the material type information, so that the rendered virtual model to be rendered meets the display requirement information.

[0135] The above method steps are performed by a computer program. On the one hand, based on the material type information of the virtual model to be rendered, a first texture template is selected from a preset texture template library, and sampling coordinates are obtained through the target point of the virtual model to be rendered, and the first texture template is sampled to obtain channel data, so as to render the target point based on the channel data; compared with the prior art method of manually setting channel data to render the virtual model, the first texture template of the virtual model to be rendered is obtained, and the channel data of the target point is automatically obtained in the first texture template to render the virtual model, which reduces the labor cost and time cost in the process of rendering the virtual model and improves the model rendering efficiency. On the other hand, after determining the first texture template, the target point is rendered based on the channel data, which effectively avoids the problem of inconsistent visual effects caused by manual setting of channel data, so that the artistic expression effect of the virtual model after rendering is consistent. On the other hand, if the display effect of the virtual model needs to be changed, it is only necessary to replace the first texture template, without adjusting the channel data of the virtual model through a large number of repeated manual operations, thereby effectively improving the flexibility and diversity of the virtual model rendering process and accelerating the iteration rate of the display effect of the virtual model.

[0136] The exemplary embodiments of the present disclosure also provide an electronic device, such as the terminal device 110 or the server 120 described above. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as a computer program. The processor executes the method steps of various exemplary embodiments of the present disclosure by executing the executable instructions. In addition, the electronic device may also include a display for displaying a graphical user interface of the virtual model to be rendered.

[0137] Reference below Fig.10 , the electronic device is exemplarily described in the form of a general-purpose computing device. It should be understood that Fig.10 The electronic device 1000 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0138] like Fig.10 As shown, the electronic device 1000 may include: a processor 1010 , a memory 1020 , a bus 1030 , an I / O (input / output) interface 1040 , a network adapter 1050 , and a display 1060 .

[0139] The processor 1010 may include one or more processing units. For example, the processor 1010 may include an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor and / or an NPU (Neural-Network Processing Unit), etc.

[0140] The processor 1010 can be used to execute executable instructions stored in the memory 1020, such as the above-mentioned rendering method, which includes the following steps: determining the virtual model to be rendered from the virtual model, and determining the material type information of the virtual model to be rendered; selecting a first texture template from a preset texture template library in combination with the display requirement information and the material type information of the virtual model to be rendered, wherein the texture template library stores multiple texture templates, each texture template is used to obtain channel data, and the channel data is used to mix the preset material texture; determining the target point in the virtual model to be rendered, and determining the sampling coordinates of the target point according to the size data of the virtual model to be rendered and the size data of the first texture template; sampling the first texture template using the sampling coordinates to obtain the channel data corresponding to the target point in each channel; rendering the target point based on the channel data and the preset material texture associated with the material type information, so that the rendered virtual model to be rendered meets the display requirement information.

[0141] The above method steps are performed by a computer program. On the one hand, based on the material type information of the virtual model to be rendered, a first texture template is selected from a preset texture template library, and sampling coordinates are obtained through the target point of the virtual model to be rendered, and the first texture template is sampled to obtain channel data, so as to render the target point based on the channel data; compared with the prior art method of manually setting channel data to render the virtual model, the first texture template of the virtual model to be rendered is obtained, and the channel data of the target point is automatically obtained in the first texture template to render the virtual model, which reduces the labor cost and time cost in the process of rendering the virtual model and improves the model rendering efficiency. On the other hand, after determining the first texture template, the target point is rendered based on the channel data, which effectively avoids the problem of inconsistent visual effects caused by manual setting of channel data, so that the artistic expression effect of the virtual model after rendering is consistent. On the other hand, if the display effect of the virtual model needs to be changed, it is only necessary to replace the first texture template, without adjusting the channel data of the virtual model through a large number of repeated manual operations, thereby effectively improving the flexibility and diversity of the virtual model rendering process and accelerating the iteration rate of the display effect of the virtual model.

[0142] The memory 1020 may include a volatile memory, such as a RAM 1021, a cache unit 1022, and may also include a non-volatile memory, such as a ROM 1023. The memory 1020 may also include one or more program modules 1024, such program modules 1024 include but are not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or a combination thereof may include the implementation of a network environment. For example, the program module 1024 may include each module in the above-mentioned apparatus 900.

[0143] The bus 1030 is used to realize the connection between different components of the electronic device 1000, and may include a data bus, an address bus, and a control bus.

[0144] The electronic device 1000 can communicate with one or more external devices 1100 (eg, a keyboard, a mouse, an external controller, etc.) through the I / O interface 1040 .

[0145] The electronic device 1000 can communicate with one or more networks through the network adapter 1050. For example, the network adapter 1050 can provide mobile communication solutions such as 3G / 4G / 5G, or provide wireless communication solutions such as wireless LAN, Bluetooth, near field communication, etc. The network adapter 1050 can communicate with other modules of the electronic device 1000 through the bus 1030.

[0146] The electronic device 1000 may display a graphical user interface through the display 1060 , such as displaying a virtual model to be rendered in the graphical user interface.

[0147] although Fig.10 Not shown, other hardware and / or software modules may also be provided in the electronic device 1000, including but not limited to: a display, a microcode, a device driver, a redundant processor, an external disk drive array, a RAID system, a tape drive, and a data backup storage system.

[0148] As can be seen from the above, the technical solution of the present disclosure can be implemented as a method, an apparatus, a system, a computer program product, an electronic device, etc. Those skilled in the art can understand that various aspects of the present disclosure can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software, such as being respectively referred to as a "circuit", "module" or "system".

[0149] It should be understood that the present disclosure is not limited to the specific method steps or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. Those skilled in the art will easily think of other embodiments based on the specific embodiments provided by the present disclosure. Therefore, the specific embodiments provided by the present disclosure are only exemplary, and the scope and spirit of the present disclosure are indicated by the claims, and any variations, uses or adaptive changes of the present disclosure should be covered, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the technical field that are not disclosed in the present disclosure.

Claims

1. A method for rendering a virtual model in a game, characterized in that: include: Determining a virtual model to be rendered from the virtual models, and determining material type information of the virtual model to be rendered; In combination with the display requirement information of the virtual model to be rendered and the material type information, a first texture template is selected from a preset texture template library, wherein the texture template library stores a plurality of texture templates, each of which is used to obtain channel data, and the channel data is used to mix the preset material texture; Determine a target point in the virtual model to be rendered, and determine a sampling coordinate of the target point according to the size data of the virtual model to be rendered and the size data of the first mapping template; The first mapping template is sampled using the sampling coordinates to obtain channel data corresponding to the target point in each channel; Based on the channel data and the preset material map associated with the material type information, the target point is rendered so that the rendered virtual model meets the display requirement information.

2. The method according to claim 1, characterized in that The virtual model to be rendered includes a plurality of areas to be processed; and determining the material type information of the virtual model to be rendered includes: The material type information of each of the areas to be processed is determined respectively.

3. The method according to claim 2, characterized in that The selecting a first texture template from a preset texture template library in combination with the display requirement information of the virtual model to be rendered and the material type information includes: In the texture template library, a texture template associated with the material type information is selected and determined as a candidate texture template corresponding to the area to be processed; Based on the display requirement information, a first mapping template of the area to be processed is determined from the candidate mapping templates.

4. The method according to claim 2, characterized in that: After determining the target point in the virtual model to be rendered, the method further includes: Acquire a target area to be processed where the target point is located in the virtual model to be rendered, and a first mapping template corresponding to the target area to be processed; The step of determining the sampling coordinates of the target point according to the size data of the virtual model to be rendered and the size data of the first mapping template includes: The sampling coordinates of the target point are determined according to the size data of the target area to be processed and the size data of the first mapping template corresponding to the target area to be processed.

5. The method according to claim 1, characterized in that The rendering of the target point based on the channel data and the preset material map associated with the material type information includes: Acquire original texture information of the target point in each of the preset material maps; each of the preset material maps is stored in a different layer of the virtual model to be rendered; Based on a preset texture mixing rule, determining a layer to be mixed corresponding to any of the channel data; The original texture information in the layer to be mixed is mixed according to any channel data to render the target point.

6. The method according to claim 1, characterized in that The step of determining the sampling coordinates of the target point according to the size data of the virtual model to be rendered and the size data of the first mapping template includes: Calculating a ratio of the size data of the virtual model to be rendered to the size data of the first mapping template; Determine the number of times the first texture template is tiled on the virtual model to be rendered according to the ratio; When the number of tiling times is greater than 1, the preset coordinates of the target point are scaled using the number of tiling times as a scaling ratio, so that the preset coordinates after the scaling processing are determined as the sampling coordinates of the target point.

7. The method according to claim 6, characterized in that The virtual model to be rendered includes a road model to be rendered; the preset coordinates include a first coordinate value and a second coordinate value, the first coordinate value is a coordinate value along the road extension direction of the road model to be rendered, and the second coordinate value is a coordinate value perpendicular to the road extension direction.

8. The method according to claim 7, characterized in that The scaling process of the preset coordinates of the target point using the number of tiling times as a scaling ratio includes: Determine a corresponding numerical interval of the first coordinate value in the sampling coordinate based on the number of tiling times; The first coordinate value is mapped to the numerical interval to perform scaling processing on the first coordinate value.

9. The method according to claim 7, characterized in that: The method further comprises: The second coordinate value is scaled according to a preset scaling ratio.

10. A rendering device for a virtual model in a game, characterized in that: include: An information acquisition module is configured to determine a virtual model to be rendered from the virtual models, and determine material type information of the virtual model to be rendered; A first texture template selection module is configured to select a first texture template from a preset texture template library in combination with the display requirement information of the virtual model to be rendered and the material type information, wherein the texture template library stores a plurality of texture templates, each of which is used to obtain channel data, and the channel data is used to mix the preset material texture; a sampling coordinate determination module, configured to determine a target point in the virtual model to be rendered, and determine the sampling coordinates of the target point according to the size data of the virtual model to be rendered and the size data of the first mapping template; A channel data acquisition module is configured to sample the first mapping template using the sampling coordinates to obtain channel data corresponding to the target point in each channel; The channel data using module is configured to render the target point based on the channel data and a preset material map associated with the material type information, so that the rendered virtual model meets the display requirement information.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

12. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 9 by executing the executable instructions.