Virtual model rendering method, device and equipment and computer readable storage medium
By detecting game events to obtain target rendering parameters and combining basic light source parameters for rendering, the problem of poor display effect of virtual models in the existing technology is solved, and better display effect and user experience is achieved.
Patent Information
- Application Number
- CN202311049747.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2025-02-21
AI Technical Summary
In the prior art, under pre-fixed lighting, it is difficult to effectively improve the display effect of the virtual model, resulting in poor display effect.
By detecting game events in the game scene, obtaining target rendering parameters, including additional light source parameters, combining preset basic light source parameters, rendering the virtual model, and dynamically adjusting the lighting to improve the display effect.
This enables additional lighting to the virtual model, making the display effect better and improving the user experience.
Smart Images

Figure CN119488709A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of rendering technology, and in particular to a virtual model rendering method, apparatus, terminal device and medium. Background Art
[0002] With the rapid development of Internet technology, there are more and more online games of various kinds. Various interfaces are usually displayed in the games. It is becoming more and more common to display virtual models in the interfaces. Improving the display effect of virtual models has also become a research hotspot.
[0003] In the related art, when displaying a virtual model in a game interface, the virtual model is rendered with a pre-fixed configured lighting. However, in the related art, under the pre-fixed configured lighting, it is easy to cause poor display effects of some virtual models. Summary of the invention
[0004] In view of the deficiencies in the above-mentioned prior art, the present application provides a virtual model rendering method, apparatus, terminal device and medium to solve the above-mentioned technical problems existing in the related art.
[0005] The technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, an embodiment of the present application provides a virtual model rendering method, which is applied to a terminal device presenting a graphical user interface, wherein the graphical user interface includes: a game scene; the method includes:
[0007] If it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, then according to the game event, the target rendering parameters are obtained; there is a mapping relationship between the game event and the target rendering parameters; the target rendering parameters at least include: additional light source parameters;
[0008] Rendering the preset virtual model according to the additional light source parameters in the target rendering parameters and the preset basic light source parameters;
[0009] The preset virtual model after lighting rendering is displayed in the model display interface.
[0010] In a second aspect, an embodiment of the present application further provides a virtual model rendering device, which is applied to a terminal device presenting a graphical user interface, wherein the graphical user interface includes: a game scene; the device includes:
[0011] The acquisition module is used to acquire target rendering parameters according to the game event if it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model; there is a mapping relationship between the game event and the target rendering parameters; the target rendering parameters at least include: additional light source parameters;
[0012] A rendering module, used for rendering the preset virtual model according to the additional light source parameters in the target rendering parameters and the preset basic light source parameters;
[0013] A display module is used to display the preset virtual model after lighting rendering in the model display interface.
[0014] In a third aspect, an embodiment of the present application further provides a terminal device, comprising: a memory and a processor, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, the virtual model rendering method described in any one of the first aspects above is implemented.
[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is read and executed, the virtual model rendering method described in any one of the first aspects above is implemented.
[0016] The beneficial effects of the present application are as follows: the embodiment of the present application provides a virtual model rendering method, including: if it is detected that a game event of a game scene meets the display triggering condition of a preset virtual model, then according to the game event, a target rendering parameter is obtained, and there is a mapping relationship between the game event and the target rendering parameter; the target rendering parameter includes at least: an additional light source parameter; according to the additional light source parameter in the target rendering parameter, and the preset basic light source parameter, the preset virtual model is rendered; a model display interface is superimposed on the game scene, and the rendered preset virtual model is displayed in the model display interface. The target rendering parameters are obtained in a targeted manner according to the game event, and the target rendering parameters obtained based on different game events with different mapping relationships will also be different. On the basis of the preset basic light source parameters, rendering is also performed based on the additional light source parameters in the target rendering parameters, which can achieve the addition of additional lighting to the preset virtual model, so that the display effect of the preset virtual model on the model display interface is better, and the user experience is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A schematic diagram of a virtual model rendering method provided in an embodiment of the present application Figure 1 ;
[0019] Figure 2 A display schematic diagram of a model display interface provided in an embodiment of the present application;
[0020] Figure 3 A schematic diagram of a virtual model rendering method provided in an embodiment of the present application Figure 2 ;
[0021] Figure 4 A schematic diagram of a virtual model rendering method provided in an embodiment of the present application Figure 3 ;
[0022] Figure 5 A schematic diagram of a virtual model rendering method provided in an embodiment of the present application Figure 4 ;
[0023] Figure 6 A schematic diagram of a virtual model rendering method provided in an embodiment of the present application Figure 5 ;
[0024] Figure 7 A schematic diagram of a virtual model rendering method provided in an embodiment of the present application Figure 6 ;
[0025] Figure 8 A schematic diagram of the structure of a virtual model rendering device provided in an embodiment of the present application;
[0026] Fig. 9 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.
[0028] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0029] In the description of the present application, it should be noted that if the terms "upper", "lower", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the drawings, or is the orientation or position relationship in which the product of the application is usually placed when used. It is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application.
[0030] In addition, the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.
[0032] The virtual model rendering method in one embodiment of the present application can be run on a local terminal device or a server. When the virtual model rendering method is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0033] In an optional implementation, various cloud applications, such as cloud games, can be run under the cloud interaction system. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the virtual model rendering method are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the player side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is used for information processing. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0034] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0035] The embodiment of the present application provides a virtual model rendering method, which is applied to a terminal device presenting a graphical user interface, wherein the graphical user interface includes: a game scene. The following is an explanation of a virtual model rendering method provided in the embodiment of the present application.
[0036] Figure 1 A flowchart of a virtual model rendering method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method may include:
[0037] S101: If it is detected that a game event of a game scene meets a preset virtual model display triggering condition, a target rendering parameter is obtained according to the game event.
[0038] There is a mapping relationship between the game event and the target rendering parameter; the target rendering parameter at least includes: additional light source parameters. In the mapping relationship, each game event can correspond to a different target rendering parameter, that is, can correspond to a different additional light source parameter.
[0039] In some implementations, some game events may occur in the game scene. When a game event occurs, it is determined whether the game event meets the display triggering condition of the preset virtual model, and then a mapping relationship is searched according to the game event to obtain the target rendering parameters.
[0040] It should be noted that the game event that meets the display trigger condition of the preset virtual model can be: when the preset virtual model appears in the game scene for the first time, or when the preset virtual model needs to be changed in the game scene; the game event can be triggered by the plot in the game scene, or by the controls displayed by the graphical user interface, and the embodiments of the present application do not impose specific restrictions on this.
[0041] In an embodiment of the present application, the terminal device can pre-store the correspondence between multiple preset game events and multiple preset rendering parameters, determine a target preset game event that matches the game event from the multiple preset game events, and use the preset rendering parameters corresponding to the target preset game event as the target rendering parameters.
[0042] S102: Rendering a preset virtual model according to the additional light source parameters in the target rendering parameters and the preset basic light source parameters.
[0043] The additional light source parameters may include: parameters such as direction, brightness and color of the additional light source, and the preset basic light source parameters may include: parameters such as direction, brightness and color of the basic light source.
[0044] It is worth mentioning that according to the additional light source parameters and the preset basic light source parameters, the preset virtual model is illuminated and rendered, so as to obtain the preset virtual model under the superposition of the additional light source and the preset basic light source, thereby improving the lighting effect of the preset virtual model and making the display effect of the preset virtual model better.
[0045] In addition, the preset virtual model is rendered according to the target rendering parameters to achieve the change of the display effect of the preset virtual model according to the target rendering parameters of the game event. For different game events, the target rendering parameters are different, and the display effect of the rendered preset virtual model is also different, making the rendering of the preset virtual model richer and more flexible.
[0046] S103: Displaying the preset virtual model after illumination rendering in the model display interface.
[0047] In some implementations, a model display interface can be superimposed on the game scene. The model display interface is a pop-up interface, which improves the display effect of the preset virtual model in the pop-up interface and improves the player's experience when observing the pop-up interface.
[0048] Figure 2 A schematic diagram of a model display interface provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, a model display interface is superimposed on the game scene, and the model display interface displays a rendered preset virtual model.
[0049] It is worth noting that the model display interface can cover part of the game scene, and the remaining game scene can still be observed by the user. This ensures that the model display interface does not deviate from the game scene during display, thereby improving the player's immersion in the game.
[0050] In addition, the rendered preset virtual model is displayed in the model display interface, which makes the effect of the rendered preset virtual model displayed in the model display interface richer and more flexible.
[0051] In the embodiment of the present application, the preset virtual model may be a preset virtual character, a preset virtual weapon, or a preset virtual item, and no specific limitation is imposed on the preset virtual model in the embodiment of the present application.
[0052] In summary, the embodiment of the present application provides a virtual model rendering method, including: if it is detected that a game event of a game scene meets the display triggering condition of a preset virtual model, then according to the game event, a target rendering parameter is obtained; according to the target rendering parameter, there is a mapping relationship between the game event and the target rendering parameter; the target rendering parameter includes at least: an additional light source parameter; according to the additional light source parameter in the target rendering parameter, the preset virtual model is rendered; a model display interface is superimposed on the game scene, and the rendered preset virtual model is displayed in the model display interface. According to the game event, the target rendering parameters are obtained in a targeted manner. Based on the game events with different mapping relationships, the obtained target rendering parameters will also be different. On the basis of the preset basic light source parameters, rendering is also performed based on the additional light source parameters in the target rendering parameters, so that additional lighting can be added to the preset virtual model, so that the display effect of the preset virtual model on the model display interface is better, and the user experience is improved.
[0053] In an embodiment of the present application, the preset basic light source parameters may be pre-set basic light source parameters, that is, the preset basic light source parameters may be used for different game events. The server may initiate a call interface through a preset scripting language to pass additional light source parameters corresponding to each preset game event to the engine, and the engine may record the additional light source parameters corresponding to each preset game event. If the terminal device detects that the game event meets the display triggering condition of the preset virtual model, it determines whether there are additional light source parameters corresponding to the game event in the engine. If so, the preset virtual model is illuminated and rendered according to the additional light source parameters corresponding to the game event and the basic light source parameters.
[0054] Optionally, the default scripting language may be Lua (a lightweight and compact scripting language).
[0055] In the embodiment of the present application, different preset additional light source parameters can also be configured for different preset model display interfaces; if the game event meets the display triggering condition of the preset virtual model, the model display interface is determined according to the game event, and the preset additional light source parameters corresponding to the model display interface are used as the additional light source parameters. Different game events can correspond to different model display interfaces, and the preset additional light source parameters corresponding to different model display interfaces are different.
[0056] During the game development process, different rendering parameters can be passed in through the preset script language calling interface in the running game, and the rendering effect in the game can be seen immediately. The artist can then adjust the rendering parameters to form a closed-loop process and finally obtain the preset rendering parameters corresponding to each model display interface.
[0057] It is worth noting that the virtual model rendering method provided in the embodiment of the present application can be applied to other game projects under the engine, saving the development cost of the game.
[0058] Optional, Figure 3 A schematic diagram of a virtual model rendering method provided in an embodiment of the present application Figure 2 ,like Figure 3 As shown, the process of rendering the preset virtual model according to the additional light source parameters in the target rendering parameters and the preset basic light source parameters in the above S102 may include:
[0059] S201 : Determine color information of each vertex on a preset virtual model according to additional light source parameters and preset basic light source parameters.
[0060] S202: Rendering a preset virtual model according to the color information of each vertex.
[0061] In some embodiments, color information of each vertex on the preset virtual model is determined according to additional light source parameters, preset basic light source parameters, and surface parameters of the preset virtual model; and rasterization rendering is performed on the preset virtual model according to the color information of each vertex.
[0062] The surface parameters of the preset virtual model may include: a surface normal and a surface color of the preset virtual model.
[0063] It is worth noting that the additional light source parameters are parameters dynamically determined according to game events, which makes the lighting rendering of the preset virtual model more flexible and rich, and makes the display effect of the preset virtual model in the model display interface more diverse.
[0064] In the embodiment of the present application, the additional light source corresponding to the additional light source parameters and the basic light source corresponding to the basic light source parameters can be any of the following: a spotlight light source, a point light source, and a surface light source, so that flexible adjustment of various lighting effects can be achieved.
[0065] Optional, Figure 4 A schematic diagram of a virtual model rendering method provided in an embodiment of the present application Figure 3 ,like Figure 4 As shown, the process of determining the color information of each vertex on the preset virtual model according to the additional light source parameters and the preset basic light source parameters in the above S201 may include:
[0066] S301. Determine first color information of each vertex according to preset basic light source parameters and preset surface parameters of the virtual model.
[0067] S302: Determine second color information of each vertex according to additional light source parameters and surface parameters of a preset virtual model.
[0068] The surface parameters of the preset virtual model may include: a surface normal and a surface color of the preset virtual model.
[0069] In the embodiment of the present application, the process of determining the color information of each vertex according to the light source parameters and the surface parameters of the preset virtual model can be referred to the following formula:
[0070] DiffuseLight=max(0,dot(N,L))*LightColor*LightStrength;
[0071] Among them, N represents the surface normal of the preset virtual model, L represents the light source direction in the light source parameters, LightColor represents the light source color in the light source parameters, LightStrength represents the light source brightness in the light source parameters, and DiffuseLight represents the diffuse light intensity received by the preset virtual model.
[0072] R = DiffuseLight * C;
[0073] Among them, C represents the surface color of the preset virtual model, when the above light source parameters are preset basic light source parameters, R represents the first color information of each vertex, and when the above light source parameters are additional light source parameters, R represents the second color information of each vertex.
[0074] S303: Determine color information according to the first color information and the second color information.
[0075] The color information may be a superposition of the first color information and the second color information.
[0076] The process of determining the color information according to the first color information and the second color information in the above S303 may include: summing the first color information and the second color information to obtain the color information.
[0077] The first color information of each vertex and the second color information of each vertex are summed to obtain the color information of each vertex.
[0078] It should be noted that rasterization rendering can be used when rendering the preset virtual model. The specific process of rasterization rendering is to calculate the color of each vertex of the preset virtual model according to the texture, material and lighting of the preset virtual model, and then obtain the color of each screen pixel through vertex interpolation to complete the drawing. In an embodiment of the present application, when there are additional light source parameters and preset basic light source parameters at the same time, the color information is determined, and the superposition of the first color information and the second color information is used.
[0079] Optional, Figure 5 A schematic diagram of a virtual model rendering method provided in an embodiment of the present application Figure 4 ,like Figure 5 As shown, the target rendering parameters include: surface mapping parameters; the method may also include:
[0080] S401. Perform lighting rendering on a preset virtual model according to preset basic light source parameters to obtain the preset virtual model after lighting rendering.
[0081] In some implementations, according to preset basic light source parameters and surface parameters of a preset virtual model, a rasterization rendering method is used to perform lighting rendering on the preset virtual model to obtain the preset virtual model after lighting rendering.
[0082] In the embodiment of the present application, the preset virtual model after lighting rendering can be represented as M1.
[0083] S402 , performing surface rendering on the preset virtual model after illumination rendering according to the surface mapping parameters.
[0084] The surface mapping parameters may include material parameters and / or texture parameters of the mapping. The material corresponding to the material parameters has a better display effect under the illumination corresponding to the preset basic light source parameters.
[0085] In an embodiment of the present application, a target map is determined according to surface map parameters, and color grading and tone mapping are performed on the target map to obtain a processed target map; based on the processed target map, surface rendering is performed on a preset virtual model after illumination rendering.
[0086] Among them, the color mapping process can be used to map the color from the original tone (usually high dynamic range) to the target tone (usually low dynamic range).
[0087] It should be noted that the target map can be processed according to parameters such as hue, saturation, brightness, contrast, etc. to obtain a processed target map. The preset virtual model in the model display interface can be made to present a cold tone effect or a warm tone effect.
[0088] In the embodiment of the present application, the target map can be represented as T, the processed target map can be represented as F(T), and after S402, the final preset virtual model obtained by rendering can be represented as: M2=M1+F(T).
[0089] In addition, the preset virtual model after lighting rendering is surface rendered to obtain a new preset virtual model. Of course, the preset virtual model after lighting rendering can be saved again, and the embodiment of the present application does not impose specific restrictions on this.
[0090] It is worth noting that it means modifying the material and texture of the preset virtual model based on the preset virtual model after lighting rendering to achieve the visual effect of simulating lighting. For example, if the existing lighting causes the skin of the preset virtual model to be dark, the color brightness and color saturation of the skin texture of the preset virtual model can be increased to achieve a better display effect without changing the lighting.
[0091] In summary, without using additional light source parameters, the preset virtual model after illumination rendering can also be surface rendered based on surface mapping parameters to change the display effect of the preset virtual model, which makes the implementation method more diverse and flexible.
[0092] Optional, Figure 6 A schematic diagram of a virtual model rendering method provided in an embodiment of the present application Figure 5 ,like Figure 6 As shown, in the above S101, if it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, the process of obtaining the target rendering parameters according to the game event may include:
[0093] S501. If the game event is a preset plot change event, determine the target plot after the change according to the preset plot change event.
[0094] If the current plot changes to the target plot, a plot change event is triggered, and the plot change event satisfies the display triggering condition of the preset virtual model.
[0095] For example, a preset plot change event may be a change in a virtual model displayed in a game scene, where a preset virtual model appears in the game scene for the first time; or it may be a change in clothing or hair accessories for a preset virtual model in the game scene; or it may be other types of preset plot change events, and the embodiments of the present application do not impose specific restrictions on this.
[0096] S502: Use the preset rendering parameters corresponding to the target plot as target rendering parameters.
[0097] In some implementations, preset rendering parameters corresponding to multiple preset plots are stored on the terminal device, a target preset plot matching the target plot is determined from the multiple preset plots, and the preset rendering parameters corresponding to the target preset plot are used as the target rendering parameters.
[0098] In an embodiment of the present application, the target plot is determined according to the plot change time, and the target rendering parameters are determined according to the target plot. For different plots, the corresponding target rendering parameters are also different. The determined target rendering parameters can change according to the changes in the plot, so that the display effect of the model display interface follows the changes in the plot, thereby improving the player experience.
[0099] Optional, Figure 7 A schematic diagram of a virtual model rendering method provided in an embodiment of the present application Figure 6 ,like Figure 7 As shown, in the above S101, if it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, the process of obtaining the target rendering parameters according to the game event may include:
[0100] S601: If the game event is an environment change event, determine the target environment after the change according to the environment change event;
[0101] If the current environment changes to the target environment, an environment change event is triggered, and the environment change event meets the display triggering condition of the preset virtual model.
[0102] S602: Use preset rendering parameters corresponding to the target environment as target rendering parameters.
[0103] In some implementations, preset rendering parameters corresponding to multiple preset environments are stored on the terminal device, a target preset environment matching the target environment is determined from the multiple preset environments, and the preset rendering parameters corresponding to the target preset environment are used as the target rendering parameters.
[0104] It should be noted that the environmental change event may be a seasonal change event, and the target environment may be a target season.
[0105] In an embodiment of the present application, the target environment is determined according to the environment change time, and the target rendering parameters are determined according to the target environment. For different environments, the corresponding target rendering parameters are also different. The determined target rendering parameters can change according to the changes in the environment, so that the display effect of the model display interface follows the environmental changes, thereby improving the player experience.
[0106] Optionally, if it is detected in S101 that a game event of the game scene meets a preset virtual model display triggering condition, the process of obtaining target rendering parameters according to the game event may include:
[0107] If the game event is: the display effect of the target part in the preset virtual model in the game scene does not meet the preset conditions, the target rendering parameters are obtained according to the surface configuration parameters of the target part.
[0108] Among them, the display effect of the target part of the preset virtual model rendered by the target rendering parameters obtained by the surface configuration parameters in the game scene meets the preset conditions.
[0109] Optionally, the display effect of the target part in the preset virtual model in the game scene does not meet a preset condition, including: a brightness value corresponding to the display brightness of the target part in the game scene is less than or equal to a preset brightness threshold.
[0110] Among them, the brightness value corresponding to the display brightness of the target part in the game scene can be obtained, and it is determined whether the brightness value corresponding to the display brightness of the target part in the game scene is less than or equal to the preset brightness threshold; if so, it is determined that the display effect of the target part in the preset virtual model in the game scene does not meet the preset conditions; if not, it is determined that the display effect of the target part in the preset virtual model in the game scene meets the preset conditions.
[0111] It is worth noting that the display effect of the target part in the preset virtual model in the game scene does not meet the preset conditions, which may be that the brightness value corresponding to the display brightness of the target part in the game scene is less than or equal to the preset brightness threshold, that is, the display effect of the target part of the preset virtual model is darker. According to the surface configuration parameters of the target part, where the surface configuration parameters may be surface material parameters, the target rendering parameters are obtained. Under the illumination corresponding to the target rendering parameters, the display effect of the material corresponding to the surface material parameters can meet the preset conditions, thereby improving the display effect of the target part in the preset virtual model.
[0112] Optionally, before the process of obtaining target rendering parameters according to the game event in S101, the method may further include:
[0113] Configure the correspondence between multiple preset game events and rendering parameters.
[0114] Among them, the correspondence between the preset multiple game events and rendering parameters can be configured through the configuration interface. The configuration interface can display a configuration control, and in response to the operation of the configuration control, the correspondence between the preset multiple game events and rendering parameters is configured. Of course, the correspondence between the preset multiple game events and rendering parameters can also be configured in the form of a table, and the embodiments of the present application do not specifically limit this.
[0115] In summary, the target rendering parameters are obtained in a targeted manner according to the game events, and the target rendering parameters obtained for different game events are different based on the mapping relationship. On the basis of the preset basic light source parameters, the additional light source parameters in the target rendering parameters are also used for rendering, which can add additional lighting to the preset virtual model, so that the display effect of the preset virtual model on the model display interface is better, and the user experience is improved. Moreover, the target game event can be a plot change event, an environmental change event, or the display effect of the target part of the preset virtual model in the game scene does not meet the preset conditions. The lighting can be changed dynamically for various game events, achieving a variety of changing lighting effects.
[0116] The following describes a virtual model rendering device, a terminal device, a storage medium, etc. used to execute the virtual model rendering method provided in this application. The specific implementation process and technical effects can be found in the relevant content of the above-mentioned virtual model rendering method, which will not be repeated below.
[0117] Figure 8 A schematic diagram of the structure of a virtual model rendering device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, the device comprises:
[0118] For example, the device may include:
[0119] The acquisition module 101 is used to acquire target rendering parameters according to the game event if it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model; there is a mapping relationship between the game event and the target rendering parameters; the target rendering parameters at least include: additional light source parameters;
[0120] A rendering module 102, configured to render the preset virtual model according to the additional light source parameters in the target rendering parameters and preset basic light source parameters;
[0121] The display module 103 is used to display the preset virtual model after illumination rendering in the model display interface.
[0122] Optionally, the rendering module 102 is specifically used to determine the color information of each vertex on the preset virtual model according to the additional light source parameters and the preset basic light source parameters; and render the preset virtual model according to the color information of each vertex.
[0123] Optionally, the rendering module 102 is specifically used to determine the first color information of each vertex according to the preset basic light source parameters and the surface parameters of the preset virtual model; determine the second color information of each vertex according to the additional light source parameters and the surface parameters of the preset virtual model; and determine the color information according to the first color information and the second color information.
[0124] Optionally, the rendering module 102 is specifically configured to sum the first color information and the second color information to obtain the color information.
[0125] Optionally, the target rendering parameters include: surface mapping parameters; the rendering module 102 is specifically used to perform lighting rendering on the preset virtual model according to the preset basic light source parameters to obtain the preset virtual model after lighting rendering; and perform surface rendering on the preset virtual model after lighting rendering according to the surface mapping parameters.
[0126] Optionally, the acquisition module 101 is specifically used to determine the changed target plot according to the preset plot change event if the game event is a preset plot change event; and use the preset rendering parameters corresponding to the target plot as the target rendering parameters.
[0127] Optionally, the acquisition module 101 is specifically used to determine the target environment after the change according to the environment change event if the game event is an environment change event; and use the preset rendering parameters corresponding to the target environment as the target rendering parameters.
[0128] Optionally, the acquisition module 101 is specifically used to acquire the target rendering parameters according to the surface configuration parameters of the target part if the game event is: the display effect of the target part in the preset virtual model in the game scene does not meet the preset conditions.
[0129] Optionally, the display effect of the target part in the preset virtual model in the game scene does not meet a preset condition, including: a brightness value corresponding to the display brightness of the target part in the game scene is less than or equal to a preset brightness threshold.
[0130] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0131] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0132] Fig. 9 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application, such as Fig. 9 As shown, the terminal device includes: a processor 201 and a memory 202.
[0133] The memory 202 is used to store programs, and the processor 201 calls the programs stored in the memory 202 to execute the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.
[0134] For example, the method may include:
[0135] If it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, then according to the game event, the target rendering parameters are obtained; there is a mapping relationship between the game event and the target rendering parameters; the target rendering parameters at least include: additional light source parameters;
[0136] Rendering the preset virtual model according to the additional light source parameters in the target rendering parameters and the preset basic light source parameters;
[0137] The preset virtual model after lighting rendering is displayed in the model display interface.
[0138] Optionally, rendering the preset virtual model according to the additional light source parameters in the target rendering parameters and preset basic light source parameters includes:
[0139] The preset virtual model is illuminated and rendered according to the additional light source parameters and the preset basic light source parameters.
[0140] Optionally, rendering the preset virtual model according to the additional light source parameters and preset basic light source parameters includes:
[0141] Determining color information of each vertex on the preset virtual model according to the additional light source parameters and the preset basic light source parameters;
[0142] The preset virtual model is rendered according to the color information of each vertex.
[0143] Optionally, determining the color information of each vertex on the preset virtual model according to the additional light source parameter and the preset basic light source parameter includes:
[0144] Determining first color information of each vertex according to the preset basic light source parameters and the surface parameters of the preset virtual model;
[0145] Determining the second color information of each vertex according to the additional light source parameters and the surface parameters of the preset virtual model;
[0146] The color information is determined according to the first color information and the second color information.
[0147] Optionally, determining the color information according to the first color information and the second color information includes:
[0148] The first color information and the second color information are summed to obtain the color information.
[0149] Optionally, the target rendering parameters include: surface mapping parameters; the method further includes:
[0150] According to the preset basic light source parameters, the preset virtual model is subjected to light rendering to obtain the preset virtual model after light rendering;
[0151] According to the surface mapping parameters, the preset virtual model after lighting rendering is subjected to surface rendering.
[0152] Optionally, if it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, obtaining the target rendering parameter according to the game event includes:
[0153] If the game event is a preset plot change event, determining the target plot after the change according to the preset plot change event;
[0154] The preset rendering parameters corresponding to the target plot are used as the target rendering parameters.
[0155] Optionally, if it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, obtaining the target rendering parameter according to the game event includes:
[0156] If the game event is an environment change event, determining the target environment after the change according to the environment change event;
[0157] The preset rendering parameters corresponding to the target environment are used as the target rendering parameters.
[0158] Optionally, if it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, obtaining the target rendering parameter according to the game event includes:
[0159] If the game event is that the display effect of the target part in the preset virtual model in the game scene does not meet the preset conditions, the target rendering parameters are obtained according to the surface configuration parameters of the target part.
[0160] Optionally, the display effect of the target part in the preset virtual model in the game scene does not meet a preset condition, including: a brightness value corresponding to the display brightness of the target part in the game scene is less than or equal to a preset brightness threshold.
[0161] To summarize, the target rendering parameters are obtained in a targeted manner according to the game events, and the target rendering parameters obtained for different game events are different based on the mapping relationship. On the basis of the preset basic light source parameters, rendering is also performed based on the additional light source parameters in the target rendering parameters. This can add additional lighting to the preset virtual model, thereby making the display effect of the preset virtual model on the model display interface better, thereby improving the user experience.
[0162] Optionally, the present application also provides a program product, such as a computer-readable storage medium, including a program, which is used to execute the above method embodiment when executed by a processor.
[0163] For example, the method may include:
[0164] If it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, then according to the game event, the target rendering parameters are obtained; there is a mapping relationship between the game event and the target rendering parameters; the target rendering parameters at least include: additional light source parameters;
[0165] Rendering the preset virtual model according to the additional light source parameters in the target rendering parameters and the preset basic light source parameters;
[0166] The preset virtual model after lighting rendering is displayed in the model display interface.
[0167] Optionally, rendering the preset virtual model according to the additional light source parameters in the target rendering parameters and preset basic light source parameters includes:
[0168] The preset virtual model is illuminated and rendered according to the additional light source parameters and the preset basic light source parameters.
[0169] Optionally, rendering the preset virtual model according to the additional light source parameters and preset basic light source parameters includes:
[0170] Determining color information of each vertex on the preset virtual model according to the additional light source parameters and the preset basic light source parameters;
[0171] The preset virtual model is rendered according to the color information of each vertex.
[0172] Optionally, determining the color information of each vertex on the preset virtual model according to the additional light source parameter and the preset basic light source parameter includes:
[0173] Determining first color information of each vertex according to the preset basic light source parameters and the surface parameters of the preset virtual model;
[0174] Determining the second color information of each vertex according to the additional light source parameters and the surface parameters of the preset virtual model;
[0175] The color information is determined according to the first color information and the second color information.
[0176] Optionally, determining the color information according to the first color information and the second color information includes:
[0177] The first color information and the second color information are summed to obtain the color information.
[0178] Optionally, the target rendering parameters include: surface mapping parameters; the method further includes:
[0179] According to the preset basic light source parameters, the preset virtual model is subjected to light rendering to obtain the preset virtual model after light rendering;
[0180] According to the surface mapping parameters, the preset virtual model after lighting rendering is subjected to surface rendering.
[0181] Optionally, if it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, obtaining the target rendering parameter according to the game event includes:
[0182] If the game event is a preset plot change event, determining the target plot after the change according to the preset plot change event;
[0183] The preset rendering parameters corresponding to the target plot are used as the target rendering parameters.
[0184] Optionally, if it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, obtaining the target rendering parameter according to the game event includes:
[0185] If the game event is an environment change event, determining the target environment after the change according to the environment change event;
[0186] The preset rendering parameters corresponding to the target environment are used as the target rendering parameters.
[0187] Optionally, if it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, obtaining the target rendering parameter according to the game event includes:
[0188] If the game event is that the display effect of the target part in the preset virtual model in the game scene does not meet the preset conditions, the target rendering parameters are obtained according to the surface configuration parameters of the target part.
[0189] Optionally, the display effect of the target part in the preset virtual model in the game scene does not meet a preset condition, including: a brightness value corresponding to the display brightness of the target part in the game scene is less than or equal to a preset brightness threshold.
[0190] To summarize, the target rendering parameters are obtained in a targeted manner according to the game events, and the target rendering parameters obtained for different game events are different based on the mapping relationship. On the basis of the preset basic light source parameters, rendering is also performed based on the additional light source parameters in the target rendering parameters. This can add additional lighting to the preset virtual model, thereby making the display effect of the preset virtual model on the model display interface better, thereby improving the user experience.
[0191] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0192] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0193] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0194] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0195] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A virtual model rendering method, characterized in that: The method is applied to a terminal device presenting a graphical user interface, wherein the graphical user interface includes a game scene; and the method includes: If it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, then according to the game event, the target rendering parameters are obtained; there is a mapping relationship between the game event and the target rendering parameters; the target rendering parameters at least include: additional light source parameters; Rendering the preset virtual model according to the additional light source parameters in the target rendering parameters and the preset basic light source parameters; The preset virtual model after lighting rendering is displayed in the model display interface.
2. The method according to claim 1, characterized in that Rendering the preset virtual model according to the additional light source parameters in the target rendering parameters and the preset basic light source parameters includes: Determining color information of each vertex on the preset virtual model according to the additional light source parameters and the preset basic light source parameters; The preset virtual model is rendered according to the color information of each vertex.
3. The method according to claim 2, characterized in that The step of determining the color information of each vertex on the preset virtual model according to the additional light source parameters and the preset basic light source parameters includes: Determining first color information of each vertex according to the preset basic light source parameters and the surface parameters of the preset virtual model; Determining the second color information of each vertex according to the additional light source parameters and the surface parameters of the preset virtual model; The color information is determined according to the first color information and the second color information.
4. The method according to claim 3, characterized in that: The determining the color information according to the first color information and the second color information includes: The first color information and the second color information are summed to obtain the color information.
5. The method according to claim 1, characterized in that The target rendering parameters include: surface mapping parameters; the method also includes: According to the preset basic light source parameters, the preset virtual model is subjected to light rendering to obtain the preset virtual model after light rendering; According to the surface mapping parameters, the preset virtual model after lighting rendering is subjected to surface rendering.
6. The method according to claim 1, characterized in that If it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, then according to the game event, the target rendering parameter is obtained, including: If the game event is a preset plot change event, determining the target plot after the change according to the preset plot change event; The preset rendering parameters corresponding to the target plot are used as the target rendering parameters.
7. The method according to claim 1, characterized in that If it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, then according to the game event, the target rendering parameter is obtained, including: If the game event is an environment change event, determining the target environment after the change according to the environment change event; The preset rendering parameters corresponding to the target environment are used as the target rendering parameters.
8. The method according to claim 1, characterized in that: If it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model, then according to the game event, the target rendering parameter is obtained, including: If the game event is that the display effect of the target part in the preset virtual model in the game scene does not meet the preset conditions, the target rendering parameters are obtained according to the surface configuration parameters of the target part.
9. The method according to claim 8, characterized in that The display effect of the target part in the preset virtual model in the game scene does not meet the preset conditions, including: the brightness value corresponding to the display brightness of the target part in the game scene is less than or equal to a preset brightness threshold.
10. A virtual model rendering device, characterized in that: The device is applied to a terminal device presenting a graphical user interface, wherein the graphical user interface includes a game scene; the device includes: The acquisition module is used to acquire target rendering parameters according to the game event if it is detected that the game event of the game scene meets the display triggering condition of the preset virtual model; there is a mapping relationship between the game event and the target rendering parameters; the target rendering parameters at least include: additional light source parameters; A rendering module, used for rendering the preset virtual model according to the additional light source parameters in the target rendering parameters and the preset basic light source parameters; A display module is used to display the preset virtual model after lighting rendering in the model display interface.
11. A terminal device, characterized in that: include: A memory and a processor, wherein the memory stores a computer program executable by the processor, and when the processor executes the computer program, the virtual model rendering method according to any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is read and executed, the virtual model rendering method described in any one of claims 1 to 9 is implemented.
Citation Information
Cited By
Game scene rendering method and system
CN120502097A