Rendering method and device

By obtaining the terminal's ambient light information to determine the rendering strategy and adjusting the virtual screen light source rendering, the problem of unclear game screens on smart terminals under different ambient light conditions is solved, achieving a better gaming experience and vision protection.

CN115089963BActive Publication Date: 2025-09-23ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210742309.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-28
Publication Date
2025-09-23
Estimated Expiration
2042-06-28

AI Technical Summary

Technical Problem

In the prior art, when a smart terminal adjusts the brightness according to the ambient light, it affects the color and special effects of the game screen, causing the user to be unable to see the screen clearly and affecting vision.

Method used

By obtaining the real ambient light information corresponding to the terminal, determining the corresponding rendering strategy, adjusting the light source rendering degree of the virtual image to adapt to different ambient lights, and generating the target virtual image.

Benefits of technology

Improves the color and special effects presentation of the game screen, enhances the user experience and protects the user's eyesight.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115089963B_ABST
    Figure CN115089963B_ABST
Patent Text Reader

Abstract

This application provides a rendering method and apparatus, wherein the rendering method comprises: obtaining ambient light information of the real environment corresponding to the terminal; determining a rendering strategy corresponding to the real environment based on the ambient light information; and generating the target virtual image based on the rendering information corresponding to the target virtual image and the rendering strategy. This method adjusts the light source rendering level of the virtual image within the game based on the ambient light of the current user's real environment, improving the rendering quality of the game image's colors, special effects, and other aspects, enhancing the user's gaming experience while protecting the user's eyes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of game technology, and more particularly to a rendering method, a rendering device, a computing device, and a computer-readable storage medium. Background Art

[0002] With the development of Internet technology and smart terminal technology, users usually use smart terminals (such as tablets, smart phones, etc.) to play games and entertainment, and the game screens are also rendered more colorful.

[0003] In the prior art, smart terminals are generally capable of adjusting terminal brightness according to the brightness of the ambient light in the current environment. For example, when a user plays a game in a dark environment, the terminal will automatically lower the brightness of the screen.

[0004] However, as the colors and special effects of game screens become richer, if the terminal only adjusts the terminal brightness according to the brightness of the ambient light, it will affect the presentation of the colors and special effects of the game screen, and will cause users to be unable to see the game screen clearly, thereby affecting the user's eyesight. Summary of the Invention

[0005] In view of this, the embodiments of the present application provide a rendering method to solve the technical defects in the prior art. The embodiments of the present application also provide a rendering apparatus, a computing device, and a computer-readable storage medium.

[0006] According to a first aspect of an embodiment of the present application, a rendering method is provided, which is applied to a terminal and includes:

[0007] Acquire ambient light information of a real environment corresponding to the terminal;

[0008] Determining a rendering strategy corresponding to the real environment based on the ambient light information;

[0009] The target virtual picture is generated based on the rendering information corresponding to the target virtual picture and the rendering strategy.

[0010] According to a second aspect of an embodiment of the present application, a rendering device is provided, including:

[0011] An acquisition module is configured to acquire ambient light information of a real environment corresponding to the terminal;

[0012] a determination module configured to determine a rendering strategy corresponding to the real environment based on ambient light information corresponding to the target virtual picture;

[0013] The generating module is configured to generate the target virtual picture based on the rendering information and the rendering strategy.

[0014] According to a third aspect of an embodiment of the present application, a computing device is provided, including:

[0015] memory and processor;

[0016] The memory is used to store computer-executable instructions, and the processor implements the steps of the rendering method when executing the computer-executable instructions.

[0017] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the rendering method are implemented.

[0018] According to a fifth aspect of the embodiments of the present application, a chip is provided, which stores a computer program, and when the computer program is executed by the chip, the steps of the rendering method are implemented.

[0019] The rendering method provided in the present application obtains the ambient light information of the real environment corresponding to the terminal, so as to realize the collection of the ambient light information of the real environment corresponding to the terminal, and provide favorable conditions for the subsequent determination of the rendering strategy; based on the ambient light information, the rendering strategy corresponding to the real environment is determined, and the rendering strategy corresponding to the real environment is determined so that the rendering picture can be adaptively changed according to the different real environments; based on the rendering information corresponding to the target virtual picture and the rendering strategy, the target virtual picture is generated, and the degree of light source rendering of the virtual picture in the game is adjusted according to the ambient light of the real environment in which the current user is located, thereby improving the color, special effects and other presentation effects of the game picture, improving the user's gaming experience, and protecting the user's eyes. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a flowchart of a rendering method provided by an embodiment of the present application;

[0021] Figure 2 A flowchart of a training method for a rendering strategy generation model provided in one embodiment of the present application is shown;

[0022] Figure 3 This is a processing flow chart of a rendering method for a game in a smart terminal provided by an embodiment of the present application;

[0023] Figure 4 This is a schematic structural diagram of a rendering device provided by an embodiment of the present application;

[0024] Figure 5 This is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0025] The following description sets forth many specific details to facilitate a thorough understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of the present application. Therefore, the present application is not limited to the specific implementations disclosed below.

[0026] The terms used in one or more embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.

[0027] It should be understood that although the terms "first," "second," and the like may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, "first" may also be referred to as "second," and similarly, "second" may also be referred to as "first," without departing from the scope of one or more embodiments of the present application.

[0028] First, the terms involved in one or more embodiments of the present invention are explained.

[0029] Ambient light information refers to the attribute information of the ambient light corresponding to the real environment in which the terminal is located, for example, the intensity and wavelength of the ambient light.

[0030] The rendering strategy refers to the rendering rules for the target virtual image corresponding to the real environment determined based on the ambient light information.

[0031] The environment type refers to the environment type corresponding to the real environment obtained by dividing the ambient light of the real environment, such as bright environment, dim environment, etc.

[0032] With the development of Internet technology and smart terminal technology, users usually use smart terminals (such as tablets, smart phones, etc.) to play games and entertainment, and the game screens are also rendered more colorful.

[0033] In the prior art, smart terminals are generally capable of adjusting terminal brightness according to the brightness of the ambient light in the current environment. For example, when a user plays a game in a dark environment, the terminal will automatically lower the brightness of the screen.

[0034] However, as the colors and special effects of game screens become richer, when users play games in a darker environment, if the terminal only adjusts the terminal brightness according to the brightness of the ambient light, it will affect the presentation of the colors, special effects, etc. of the game screen, and will cause the user to be unable to see the game screen clearly, thereby affecting the user's eyesight.

[0035] This application provides a rendering method, a rendering apparatus, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments.

[0036] Figure 1 A flowchart of a rendering method according to an embodiment of the present application is shown, which specifically includes the following steps:

[0037] Step 102: Acquire ambient light information of a real environment corresponding to the terminal.

[0038] The ambient light information refers to the attribute information of the ambient light in the real environment corresponding to the terminal, which may be the wavelength information and frequency information of the ambient light, or the intensity information of the ambient light.

[0039] Based on this, in an embodiment of the present application, attribute information of the ambient light in the real environment corresponding to the terminal is obtained. Specifically, the spectrum of the ambient light in the real environment corresponding to the terminal can be obtained to determine the wavelength information, frequency information, and / or intensity information of the ambient light. By obtaining the ambient light information of the real environment in response to the rendering instruction, the ambient light information of the real environment in which the terminal is located can be obtained in a timely manner, providing favorable conditions for subsequently determining the rendering strategy based on the ambient light information, and can improve the accuracy of the determined rendering strategy.

[0040] Furthermore, in order to accurately obtain the ambient light information of the real environment corresponding to the terminal, this can be achieved by calling the photosensitive element. The specific implementation method is as follows:

[0041] The light sensing element corresponding to the terminal is called; and ambient light information of the real environment corresponding to the terminal is collected through the light sensing element.

[0042] The photosensitive element can be installed on the terminal or used as a separate photosensitive device connected to the terminal via a wired or wireless connection. The photosensitive element can be any device capable of collecting ambient light, such as an ambient light sensor, which is composed of a photosensitive element and can sense ambient light conditions. In some embodiments, the photosensitive element can also be a sensor with an ideal spectral response.

[0043] In actual applications, when the photosensitive element is wirelessly connected to the terminal, the photosensitive element and the terminal may not be in the same position. At this time, the ambient light information collected by the photosensitive element may be different from the ambient light information of the real environment where the terminal is actually located. In order to avoid the occurrence of this phenomenon, the rendering method provided in this embodiment can determine the ambient light change information between the position of the photosensitive element and the position of the terminal based on the respective position information of the photosensitive element and the terminal. Based on the ambient light information collected by the photosensitive element and the ambient light change information, the ambient light information of the real environment corresponding to the terminal can be determined. The accuracy of the obtained ambient light information of the real environment corresponding to the terminal can be guaranteed, which provides favorable conditions for the subsequent determination of the rendering strategy corresponding to the real environment based on the ambient light information, and further improves the accuracy of the rendering strategy.

[0044] For example, when the photosensitive element is located under the light in the house and the terminal is located at the door of the house, the photosensitive element collects the ambient light information under the light. Based on the position information of the photosensitive element and the position information of the terminal, the ambient light change information between the photosensitive element and the terminal can be determined, and based on the ambient light change information and the ambient light information collected by the photosensitive element, the ambient light information of the terminal at the door of the house can be determined.

[0045] Specifically, a photosensitive element corresponding to the terminal may be called to collect ambient light information of the real environment corresponding to the terminal using the photosensitive element.

[0046] Continuing with the previous example, the terminal's corresponding ambient light sensor is called to collect the spectrum of the ambient light in the terminal's real environment, thereby obtaining the wavelength and frequency information of the ambient light. Furthermore, the ambient light sensor can also analyze the intensity of the ambient light to obtain the ambient light intensity information. Consequently, the ambient light information corresponding to the terminal's real environment is determined to be strong light.

[0047] In addition, in response to the received rendering instructions, the photosensitive element can be called to collect ambient light information of the real environment. The rendering instructions can provide an instruction information to the photosensitive element, so that the photosensitive element does not need to be in a continuous collection state, which can reduce energy consumption and extend the use time of the photosensitive element.

[0048] In summary, by calling the photosensitive element and collecting the ambient light information of the real environment through the photosensitive element, the ambient light information of the real environment in which the terminal is located can be obtained in a timely manner, the accuracy of the obtained ambient light information can be improved, and favorable conditions can be provided for the subsequent determination of the rendering strategy.

[0049] Step 104: Determine a rendering strategy corresponding to the real environment based on the ambient light information.

[0050] Among them, the rendering strategy refers to the rendering rules for generating the target virtual image, which corresponds to the real environment. It can be understood that when the ambient light of the real environment in which the terminal is located changes, the determined rendering strategy will also change.

[0051] Specifically, after obtaining the ambient light information of the real environment in step 102 , a rendering strategy corresponding to the real environment is determined based on the obtained ambient light information.

[0052] Continuing with the above example, the ambient light information of the real environment is determined to be strong light. In this case, the rendering strategy corresponding to the real environment is determined to be "matte anti-glare", that is, the intensity of colors in the target virtual image that are necessary but irritating to the user's eyes is lowered, and the direct light in the target virtual image is changed to scattered light, so that the light path when rendering to generate the target virtual image is dispersed.

[0053] In other embodiments, when the ambient light information of the determined real environment is weak light, the rendering strategy determined at this time is "anti-blue light" so that the special effects, colors, etc. in the target virtual picture will not be too glaring.

[0054] In addition, the rendering strategy can also be "day and night alternation". Specifically, when the ambient light information of the real environment is strong light, the scene color in the target virtual screen can be converted to a daytime scene, so that the color in the target virtual screen is adapted to the real environment; correspondingly, when the ambient light information of the real environment is weak light or no light, the scene color in the target virtual screen can be converted to a night scene.

[0055] In other embodiments of the present application, the environment type may further include the color of the ambient light. The color of the ambient light may be determined based on the acquired wavelength information and frequency information of the ambient light, and then the rendering strategy may be determined according to the color of the ambient light.

[0056] Specifically, the correspondence between the wavelength and frequency information of ambient light and its color is shown in Table 1 below, and the correspondence between the color of ambient light and the rendering strategy can be shown in Table 2 below. A rendering strategy can be determined based on ambient light information using a preset correspondence table, or a rendering strategy generation model can be trained using ambient light information and its corresponding rendering strategy as training samples, and the rendering strategy can be determined using the rendering strategy generation model.

[0057] The correspondence between ambient light information and rendering strategies can be determined based on the visual acuity characteristics of the human eye. The visual acuity characteristics of the human eye refer to the different sensitivity characteristics of the human eye to light of different wavelengths. The visual acuity characteristics of the human eye are measured and described by the visual acuity function and the relative visual acuity function. The visual acuity function refers to the reciprocal of the radiation power of light of different wavelengths under the same brightness perception condition, which can be used to measure the sensitivity of the human eye to the brightness perception of light of each wavelength. The relative visual acuity function refers to the ratio of the visual acuity function of light of any wavelength to the maximum visual acuity function value, where the maximum visual acuity function value refers to the wavelength of light to which the human eye is most sensitive, which is 555nm.

[0058] Based on this, it can be determined that the human eye is most sensitive to yellow light and green light under bright conditions, and least sensitive to red light and violet light; under dark conditions, the human eye is most sensitive to the brightness of green light, and least sensitive to red light and violet light.

[0059] In summary, determining the correspondence between ambient light information and rendering strategies through the visual acuity characteristics of the human eye can provide favorable conditions for subsequently determining rendering strategies based on ambient light information. Moreover, determining the correspondence by analyzing the visual acuity characteristics of the human eye can also enable the determined rendering strategies to effectively protect the user's eyes.

[0060]

[0061] Table 1

[0062]

[0063]

[0064] Table 2

[0065] For example, the ambient light sensor collects the spectral information of the ambient light in the current real environment, and determines that the wavelength information of the ambient light is 650nm and the frequency information is 450THz based on the spectral information. At this time, based on the wavelength information and frequency information, by querying Table 1, it can be determined that the color of the current ambient light is red. Based on the determined ambient light color is red, by querying Table 2 or inputting the ambient light color into the rendering strategy generation model, the output rendering strategy can be "rendering the colors in the scene as cyan" or "rendering the colors in the scene as green."

[0066] In summary, by determining the rendering strategy corresponding to the real environment based on ambient light information, the rendering scheme of the target virtual image can be changed as the ambient light changes, so that the color displayed by the target virtual image is adapted to the ambient light corresponding to the real environment, thereby ensuring the presentation effect of color and special effects in the target virtual image, while also protecting the user's eyes.

[0067] Furthermore, when ambient light information indicates that the user has been in an extremely dark or bright environment for a long period of time, that is, when the ambient light exceeds the normal light source range, a warning can be issued to remind the user of the excessive time, thereby protecting the user's eyes. It is understood that the warning can be issued as a pop-up window in the target virtual screen, or through a push notification on the terminal, or a voice prompt issued through the terminal's speaker.

[0068] Furthermore, generally speaking, after the spectrum of ambient light is collected by a photosensitive element, the wavelength and intensity of the ambient light can be determined by the intensity of the electrical signal converted by the spectrum and the photosensitive element. In order to facilitate the determination of a rendering strategy based on the ambient light information, the environment type can be determined based on the ambient light information, thereby dividing the ambient light into different wavelength and intensity ranges, and then classifying the ambient light. The specific implementation method is as follows:

[0069] Based on the ambient light information, an environment type of a real environment corresponding to the terminal is determined; based on the environment type, a rendering strategy corresponding to the real environment is determined.

[0070] Specifically, the environment type can be used to indicate the brightness of the environment, corresponding to the range of ambient light information. When the wavelength and intensity of the ambient light are within the strong light range, the corresponding environment type is bright, and the corresponding rendering strategy is "matte anti-glare". When the wavelength and intensity of the ambient light are within the weak light range, the corresponding environment type is dim, and the corresponding rendering strategy is "anti-blue light". The environment type can also be used to indicate the color of the ambient light, which can be determined based on the wavelength and frequency information of the ambient light.

[0071] Continuing with the above example, if the ambient light information is determined to be strong light, the actual environment type can be determined to be bright, and the corresponding rendering strategy can be determined to be "matte anti-glare." If the ambient light wavelength is determined to be 650nm and the ambient light frequency is determined to be 450THz, the actual environment type can be determined to be red, and the corresponding rendering strategy in this case is "render the colors in the scene as cyan."

[0072] It is understood that the correspondence between ambient light information and environment types can be pre-set in a correspondence table. After obtaining the ambient light information, the environment type corresponding to the ambient light information can be queried in the correspondence table. In other embodiments, a pre-trained model can also be used to determine the environment type corresponding to the ambient light information based on the ambient light information.

[0073] In summary, since ambient light information usually includes the wavelength information, frequency information and intensity information of the ambient light, in order to facilitate the storage and query of the correspondence between the real environment in which the terminal is located and the rendering strategy, the environment type is first determined based on the ambient light information, and then the rendering strategy is determined based on the environment type, which can improve the generation efficiency of the rendering strategy.

[0074] Furthermore, in order to determine the environment type of the real environment corresponding to the terminal, it can usually be determined based on the intensity and / or wavelength of the ambient light. The specific implementation method is as follows:

[0075] determining, based on the ambient light information, an ambient light intensity and / or wavelength corresponding to the real environment;

[0076] Determine the environment type of the real environment corresponding to the terminal according to the ambient light intensity and / or wavelength.

[0077] Specifically, determining the environment type based on ambient light intensity and wavelength allows for a more accurate representation of ambient light. This improves the compatibility of rendering strategies with the real environment, thereby enhancing the presentation of the target virtual image in the real environment. Furthermore, the environment type can be determined based on wavelength and frequency, or intensity, wavelength, and frequency, further enhancing the accuracy of the representation.

[0078] Furthermore, in the process of determining the rendering strategy corresponding to the real environment based on the environment type, a pre-trained rendering strategy generation model can be used to improve the generation efficiency and accuracy of the rendering strategy. The specific implementation method is as follows:

[0079] Inputting the environment type into a pre-trained rendering strategy generation model;

[0080] Obtain a rendering strategy output by the rendering strategy generation model.

[0081] Continuing with the above example, the determined environment type "bright" is input into the pre-trained rendering strategy generation model. The rendering strategy generation model outputs the corresponding rendering strategy "matte anti-glare" based on the input environment type.

[0082] In addition, in the embodiments provided in the present application, an external interface can be generated based on the rendering strategy generation model. The external interface can communicate with a third party and then receive rendering information and ambient light information sent by the third party. After the external interface receives the rendering information and ambient light information, it can output the corresponding rendering strategy through the rendering strategy generation model and feed back the rendering strategy to the third party through the external interface, so that the third party can also use the rendering strategy generation model to generate a rendering strategy through the interface.

[0083] In summary, by using the trained rendering strategy generation model to generate rendering strategies, the generation efficiency and accuracy of rendering strategies can be improved. Moreover, the rendering strategy generation model can be trained at any time to update the rendering strategy, so that when the rendering strategy needs to be updated, there is no need to reset the correspondence between the rendering strategy and the environment type, thereby improving efficiency.

[0084] Below, we further explain the training process of the rendering strategy generation model. Figure 2 , Figure 2 A flow chart of a training method for a rendering strategy generation model provided in an embodiment of the present application is shown, as shown in the figure.

[0085] Step 202: Obtain a sample environment type and a sample rendering strategy corresponding to the sample environment type.

[0086] The sample environment type is the environment type corresponding to the real environment, and the sample rendering strategy is the rendering strategy determined according to the environment type.

[0087] Step 204: Input the sample environment type into the initial rendering strategy generation model.

[0088] At this time, the initial rendering strategy generation model is a rendering strategy generation model that has not been trained yet. It needs to be trained with the sample environment type and the sample rendering strategy corresponding to the sample environment type. Specifically, the sample environment type is input into the initial rendering strategy generation model.

[0089] Step 206: Obtain the predicted rendering strategy output by the initial rendering strategy generation model.

[0090] Among them, the predicted rendering strategy is the output of the initial rendering strategy generation model that has not yet been trained. The predicted rendering strategy at this time is not an accurate rendering strategy.

[0091] Step 208: Calculate a model loss value according to the predicted rendering strategy and the sample rendering strategy.

[0092] At this time, the rendering strategy generation model has not been trained yet, and there is still a certain gap between the output predicted rendering strategy and the sample rendering strategy. Therefore, it is necessary to jointly train the model through the predicted rendering strategy and the sample rendering strategy to adjust the model parameters. Specifically, it is necessary to calculate the model loss value based on the predicted rendering strategy and the sample rendering strategy. The loss function for calculating the model loss value in actual applications can be a cross entropy loss function, absolute value loss function, square loss function, 0-1 loss function, etc. In this application, there is no limitation on the choice of loss function, and it is subject to actual application.

[0093] Optionally, calculating the model loss value according to the predicted rendering strategy and the sample rendering strategy includes: inputting the predicted rendering strategy and the sample rendering strategy into a target loss function; and obtaining the model loss value output by the target loss function.

[0094] In practical applications, it is necessary to select a suitable target loss function according to the actual application scenario, and input the predicted rendering strategy and the sample rendering strategy into the target loss function for calculation to obtain the model loss value. In this application, the cross-entropy loss function is used as an example for explanation. The gradient of the last layer of weights in the cross-entropy loss function is no longer related to the inverse of the activation function, but is only proportional to the difference between the output value and the true value. At this time, the cross-entropy loss function converges faster, and because backpropagation is multiplied, the update of the entire weight matrix is ​​faster, and the cross-entropy loss derivation is simpler. Therefore, the cross-entropy loss function can be preferably used in this application.

[0095] Step 210: Adjust the model parameters of the initial rendering strategy generation model according to the model loss value, and continue to train the initial rendering strategy generation model until the model training stop condition is reached to obtain the rendering strategy generation model.

[0096] After calculating the loss value, the model parameters of the rendering strategy generation model can be adjusted based on the loss value backpropagation.

[0097] In practical applications, the training stop conditions include:

[0098] The model loss value is less than a preset threshold; and / or

[0099] The training rounds of the rendering strategy generation model reach a preset round.

[0100] In a specific implementation provided in the present application, taking the example of stopping the training of the text recognition model when the model loss value is less than a preset threshold, the preset threshold is 0.3. When the calculated model loss value is less than 0.3, it is determined that the rendering strategy generation model training is completed.

[0101] In another specific embodiment provided in the present application, taking the preset training rounds to stop training the text recognition model as an example, the preset training rounds are 10 rounds. When the training rounds of the sample data reach 10 rounds, it is determined that the rendering strategy generation model has been trained.

[0102] In another specific embodiment provided in the present application, two training stop conditions are set: a preset loss value threshold and a preset number of training rounds. The model loss value and training rounds are monitored simultaneously. When either or both of the model loss value and the number of training rounds meet the training stop conditions, the rendering strategy generation model is deemed to have been trained. That is, when the model loss value is less than the preset loss value threshold or the number of training rounds reaches the preset number of training rounds, or when the model loss value is less than the preset loss value threshold and the number of training rounds reaches the preset number of training rounds, the rendering strategy generation model is deemed to have been trained.

[0103] In addition, the rendering strategy generation model can correspond to different games, the rendering strategy generation model can exist independently of the terminal, and a custom rendering strategy can also be implemented based on the rendering strategy generation model.

[0104] In another embodiment of the present application, a rendering strategy corresponding table may be set to implement determining a rendering strategy based on the environment type. The specific implementation is as follows:

[0105] Based on the environment type, query the preset rendering strategy corresponding table;

[0106] Get the rendering strategy corresponding to the environment type.

[0107] The preset rendering strategy correspondence table stores the correspondence between the environment types and the rendering strategies.

[0108] Continuing with the above example, the preset rendering strategy correspondence table may store correspondences such as “bright-matte anti-glare” and “dim-anti-blue light”.

[0109] Alternatively, the preset rendering strategy corresponding table may further store an interval range of ambient light information corresponding to the environment type.

[0110] In summary, by presetting the rendering strategy correspondence table, the rendering strategy can be directly obtained by querying the rendering strategy correspondence table, thereby improving the efficiency of generating the rendering strategy.

[0111] The following is a further explanation of the generation process of the rendering strategy correspondence table. The specific implementation is as follows:

[0112] Collect ambient light information corresponding to the real environment;

[0113] Based on the ambient light information, determining an environment type corresponding to the ambient light information;

[0114] Based on the environment type, determining a rendering strategy corresponding to the environment type;

[0115] generating a correspondence between the environment type and the rendering strategy based on the environment type and the rendering strategy corresponding to the environment type;

[0116] Based on the correspondence between the environment type and the rendering strategy, the rendering strategy correspondence table is constructed.

[0117] Step 106: Generate the target virtual picture based on the rendering information corresponding to the target virtual picture and the rendering strategy.

[0118] Among them, the target virtual screen refers to the virtual screen displayed on the display interface of the terminal. Rendering information can be issued by the terminal or by the game the user is playing. Rendering information refers to the information needed to render and generate the target virtual screen. For example, rendering information can include scene rendering information, character rendering information, and color rendering information. Scene rendering information can be used to render and generate scenes in the target virtual screen. Character rendering information can be used to render and generate bosses, NPCs, and game characters in the target virtual screen. Color rendering information can be used to render and generate colors, special effects, etc. in the target virtual screen.

[0119] It can be understood that the rendering method provided in the embodiments of the present application can be used to generate the target virtual screen in the game, the rendering method can be executed using a smart terminal, and the rendering method provided in the embodiments of the present application can be used in conjunction with different games to achieve adjustment of the target virtual screen in the game.

[0120] Specifically, the rendering information can be used to render and generate a corresponding target virtual screen, providing favorable conditions for subsequent generation of the target virtual screen.

[0121] Based on this, in an embodiment of the present application, rendering information can be received from a smart terminal or from a game, and the instruction terminal can generate a target virtual screen corresponding to the rendering information. The rendering information may include scene rendering information, task rendering information, and color rendering information corresponding to the target virtual screen, etc. These rendering information can be used to generate a target virtual screen corresponding to the rendering instruction.

[0122] For example, rendering information corresponding to a target virtual screen is received, where the target virtual screen is "a game character attacking a game boss on the edge of a cliff." The rendering information includes scene rendering information, character rendering information, and color rendering information corresponding to the target virtual screen. The scene rendering information includes rendering information corresponding to the cliff, and the cliff scene in the target virtual screen can be generated based on this scene rendering information; the character rendering information includes rendering information corresponding to the game character and rendering information corresponding to the game boss, and the game character and game boss in the target virtual screen can be generated based on this character rendering information; and the color rendering information includes color information related to the cliff scene, color information related to the game character, color information related to the skill special effects being released by the game character, color information related to the game boss, and color information related to the damage special effects received by the game boss when being attacked, etc. Based on this color rendering information, the colors of all scenes, tasks, and special effects in the target virtual screen can be generated. Based on the above rendering information, a virtual screen of "a game character attacking a game boss on the edge of a cliff" can ultimately be generated.

[0123] Furthermore, the rendering information may come from a rendering instruction issued by the terminal or a third party, and the specific implementation method is as follows:

[0124] A rendering instruction is received, wherein the rendering instruction carries rendering information corresponding to the target virtual picture.

[0125] Among them, the rendering instruction refers to the instruction for rendering and generating the target virtual screen. It can be understood that the rendering instruction can be issued by the smart terminal or by the game the user is playing; the target virtual screen refers to the virtual screen requested to be rendered in the rendering instruction.

[0126] Based on this, a rendering instruction carrying rendering information corresponding to a target virtual picture may be received from a terminal or a third party, where the rendering instruction is used to instruct generation of the target virtual picture on a display interface of the terminal.

[0127] Continuing with the above example, a rendering instruction for generating a target virtual image of "a game character is attacking a game boss on the edge of a cliff" is received. The rendering instruction carries rendering information corresponding to "a game character is attacking a game boss on the edge of a cliff."

[0128] In summary, by receiving a rendering instruction carrying rendering information corresponding to a target virtual picture, the original rendering information of the target virtual picture to be rendered can be determined, which provides favorable conditions for subsequent generation of the target virtual picture.

[0129] Specifically, the rendering information is adjusted and modified using the rendering strategy, and a target virtual image is generated based on the adjusted rendering information. This target virtual image is different from the original virtual image generated based solely on the rendering information. Because the rendering strategy adjusts the rendering information, the generated target virtual image adapts to the terminal's real environment, achieving the goal of adjusting the original virtual image based on the ambient light in the real environment to generate the target virtual image.

[0130] Continuing with the above example, the rendering strategy determined is "matte anti-glare". Based on this rendering strategy and rendering information, a target virtual picture of "a game character attacking a game boss on the edge of a cliff" is generated. At this time, the color intensity in the target virtual picture is lowered, and the light source in the target virtual picture is adjusted to scattered light.

[0131] In addition, in order to ensure flexibility and personalized settings for rendering to generate a target virtual picture, the rendering strategy may further include adjusting part of the scene in the target virtual picture, and adjusting part of the rendering information based on the rendering strategy to generate the target virtual picture.

[0132] For example, based on the rendering strategy, the scene rendering information in the rendering information can be adjusted to adjust the color of leaves in the target virtual screen to yellow, or adjust the color of the attack special effects being launched by the game character in the target virtual screen to purple.

[0133] Furthermore, the rendering method provided in this embodiment can also perform personalized rendering of the game screen for different game users based on the game user's historical information. Specifically, the rendering method provided in this embodiment can collect the historical information of the current game user, determine the current game user's preference information based on the historical information, and determine the rendering strategy based on the preference information. In addition, the rendering method provided in this embodiment can also perform personalized rendering of the current game user's game screen based on the game user's input information.

[0134] For example, the historical information of the current game user A is that the brightness is manually adjusted to the maximum brightness during the game, and the preference information of game A is determined to be a preference for a higher brightness in the game. The rendering strategy determined based on the preference information may include appropriately reducing the brightness or only adjusting the picture color and scene without adjusting the brightness.

[0135] Furthermore, in order to generate a target virtual image corresponding to the real environment, it is necessary to adjust the rendering information through a rendering strategy so that the generated target virtual image is adapted to the ambient light in the real environment. The specific implementation method is as follows:

[0136] Determining rendering sub-information to be adjusted in the rendering information;

[0137] Based on the rendering strategy, adjusting the rendering sub-information to be adjusted to obtain target rendering information;

[0138] Based on the target rendering information, a target virtual picture corresponding to the target rendering information is generated by rendering.

[0139] Specifically, in order to ensure the presentation effect of the color, special effects, etc. of the game screen, not only the screen brightness of the terminal is adjusted, but also the rendering degree of the color in the target virtual screen is adjusted. Therefore, the rendering sub-information to be adjusted in the determined rendering information refers to the color rendering information. By adjusting the color rendering information, the rendering degree of the color in the target virtual screen can be adjusted.

[0140] Based on this, in an embodiment of the present application, based on the rendering strategy, the color rendering information in the rendering information is adjusted to obtain the target rendering information, wherein the target rendering information includes the original scene rendering information and character rendering information in the rendering information, as well as the adjusted color rendering information. Based on the target rendering information, the target virtual picture is rendered and generated, thereby realizing the adjustment of the color rendering degree of the game picture based on the ambient light, improving the color, special effects, etc. presentation effects of the game picture under different ambient lights, improving the user's gaming experience, and protecting the user's eyes.

[0141] The following combined Figure 3 Taking the rendering method provided in this application for a game in a smart terminal as an example, the rendering method is further explained. Figure 3 A processing flow chart of a rendering method for a game in a smart terminal provided in an embodiment of the present application is shown, which specifically includes the following steps.

[0142] Step 302: Receive a rendering instruction, wherein the rendering instruction carries rendering information corresponding to the target game screen.

[0143] The rendering information includes scene rendering information, character rendering information, and color rendering information for rendering and generating the original game screen. The original game screen can be generated according to the rendering information.

[0144] Step 304: In response to the rendering instruction, obtain ambient light information of the real environment corresponding to the terminal.

[0145] After receiving the rendering instruction, the terminal responds to the rendering instruction and obtains the ambient light information of the real environment at that time through the photosensitive element.

[0146] Step 306: Determine the environment type of the real environment corresponding to the terminal based on the ambient light information.

[0147] Based on the wavelength and intensity of the ambient light included in the ambient light information, the environment type of the real environment in which the terminal is currently located is determined.

[0148] Step 308: Based on the environment type, determine a rendering strategy corresponding to the real environment through a pre-trained rendering strategy generation model.

[0149] The environment type is input into the pre-trained rendering strategy generation model to obtain the rendering strategy output by the rendering strategy generation model.

[0150] Step 310: Based on the rendering strategy, adjust the color rendering information in the rendering information to obtain target rendering information.

[0151] The target rendering information includes original scene rendering information, character rendering information, and adjusted color rendering information.

[0152] Step 312: Based on the target rendering information, render and generate a target game screen corresponding to the target rendering information.

[0153] Based on this, a target game screen is generated that corresponds to the ambient light of the real environment in which the terminal is located, thereby enabling the user to adjust the rendering degree of the game screen according to the ambient light when playing games under different ambient light conditions.

[0154] To sum up, the rendering method provided in the present application obtains the ambient light information of the real environment corresponding to the terminal, so as to realize the collection of the ambient light information of the real environment corresponding to the terminal, and provide favorable conditions for the subsequent determination of the rendering strategy; based on the ambient light information, the rendering strategy corresponding to the real environment is determined, and the rendering strategy corresponding to the real environment is determined, so that the rendering picture can be adaptively changed according to the different real environments; based on the rendering information corresponding to the target virtual picture and the rendering strategy, the target virtual picture is generated, and the degree of light source rendering of the virtual picture in the game is adjusted according to the ambient light of the real environment in which the current user is located, thereby improving the color, special effects and other presentation effects of the game picture, improving the user's gaming experience, and protecting the user's eyes.

[0155] Corresponding to the above method embodiment, the present application also provides a rendering device embodiment, Figure 4 FIG. 1 shows a schematic diagram of the structure of a rendering device provided by an embodiment of the present application. Figure 4 As shown, the device includes:

[0156] An acquisition module 402 is configured to acquire ambient light information of a real environment corresponding to the terminal;

[0157] A determination module 404 is configured to determine a rendering strategy corresponding to the real environment based on the ambient light information;

[0158] The generating module 406 is configured to generate the target virtual picture based on the rendering information corresponding to the target virtual picture and the rendering strategy.

[0159] Optionally, the determining module 404 is further configured to:

[0160] Determining, based on the ambient light information, an environment type of a real environment corresponding to the terminal;

[0161] Based on the environment type, a rendering strategy corresponding to the real environment is determined.

[0162] Optionally, the determining module 404 is further configured to:

[0163] determining, based on the ambient light information, an ambient light intensity and / or wavelength corresponding to the real environment;

[0164] Determine the environment type of the real environment corresponding to the terminal according to the ambient light intensity and / or wavelength.

[0165] Optionally, the determining module 404 is further configured to:

[0166] Inputting the environment type into a pre-trained rendering strategy generation model;

[0167] Obtain a rendering strategy output by the rendering strategy generation model.

[0168] Optionally, the determining module 404 is further configured to:

[0169] Based on the environment type, query the preset rendering strategy corresponding table;

[0170] Get the rendering strategy corresponding to the environment type.

[0171] Optionally, the generating module 406 is further configured to:

[0172] Determining rendering sub-information to be adjusted in the rendering information;

[0173] Based on the rendering strategy, adjusting the rendering sub-information to be adjusted to obtain target rendering information;

[0174] Based on the target rendering information, a target virtual picture corresponding to the target rendering information is generated by rendering.

[0175] Optionally, the acquisition module 402 is further configured to:

[0176] calling a photosensitive element corresponding to the terminal;

[0177] The ambient light information of the real environment corresponding to the terminal is collected through the photosensitive element.

[0178] Optionally, the device further includes a training module configured to:

[0179] Obtaining a sample environment type and a sample rendering strategy corresponding to the sample environment type;

[0180] inputting the sample environment type into an initial rendering strategy generation model;

[0181] Obtaining a predicted rendering strategy output by the initial rendering strategy generation model;

[0182] Calculating a model loss value according to the predicted rendering strategy and the sample rendering strategy;

[0183] Adjust the model parameters of the initial rendering strategy generation model according to the model loss value, and continue to train the initial rendering strategy generation model until the model training stop condition is reached to obtain the rendering strategy generation model.

[0184] Optionally, the device further comprises a building module configured to:

[0185] Collect ambient light information corresponding to the real environment;

[0186] Based on the ambient light information, determining an environment type corresponding to the ambient light information;

[0187] Based on the environment type, determining a rendering strategy corresponding to the environment type;

[0188] generating a correspondence between the environment type and the rendering strategy based on the environment type and the rendering strategy corresponding to the environment type;

[0189] Based on the correspondence between the environment type and the rendering strategy, the rendering strategy correspondence table is constructed.

[0190] The above is a schematic scheme of a rendering device of this embodiment. It should be noted that the technical solution of the rendering device and the technical solution of the rendering method mentioned above belong to the same concept. For details not described in detail in the technical solution of the rendering device, please refer to the description of the technical solution of the rendering method mentioned above. In addition, the various components in the device embodiment should be understood as functional modules that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through the computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.

[0191] Figure 5 The block diagram shows a structure of a computing device 500 according to an embodiment of the present application. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and a database 550 is used to store data.

[0192] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)), whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0193] In one embodiment of the present application, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 5 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0194] Computing device 500 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 500 can also be a mobile or stationary server.

[0195] The processor 520 is configured to execute computer executable instructions of the rendering method.

[0196] The above is a schematic solution of a computing device of this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the rendering method described above are of the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the rendering method described above.

[0197] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which are used for a rendering method when executed by a processor.

[0198] The above is a schematic solution of a computer-readable storage medium of this embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the rendering method described above are of the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the rendering method described above.

[0199] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0200] An embodiment of the present application further provides a chip storing a computer program, which implements the steps of the rendering method when executed by the chip.

[0201] It should be noted that for the aforementioned method embodiments, for ease of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0202] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0203] The preferred embodiments of the present application disclosed above are intended only to help illustrate the present application. The optional embodiments do not describe all details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of this application. This application selects and describes these embodiments in detail in order to better explain the principles and practical applications of this application, so that those skilled in the art can better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.

Claims

1. A rendering method, characterized in that: Applied to terminals, including: Acquire ambient light information of a real environment corresponding to the terminal; Determining a rendering strategy corresponding to the real environment based on the ambient light information; determining the rendering strategy corresponding to the real environment based on the ambient light information includes: obtaining a description of visual acuity characteristics of a human eye, determining a correspondence between the ambient light information and the rendering strategy based on the visual acuity characteristics of the human eye, and determining the rendering strategy corresponding to the real environment based on the correspondence, wherein the visual acuity characteristics refer to the different sensitivity characteristics of the human eye to light of different wavelengths; The target virtual picture is generated based on the rendering information corresponding to the target virtual picture and the rendering strategy.

2. The method according to claim 1, characterized in that The determining, based on the ambient light information, a rendering strategy corresponding to the real environment includes: Determining, based on the ambient light information, an environment type of a real environment corresponding to the terminal; Based on the environment type, a rendering strategy corresponding to the real environment is determined.

3. The method according to claim 2, characterized in that The determining, based on the ambient light information, an environment type of a real environment corresponding to the terminal includes: determining, based on the ambient light information, an ambient light intensity and / or wavelength corresponding to the real environment; Determine the environment type of the real environment corresponding to the terminal according to the ambient light intensity and / or wavelength.

4. The method according to claim 2, characterized in that The determining, based on the environment type, a rendering strategy corresponding to the real environment includes: Inputting the environment type into a pre-trained rendering strategy generation model; Obtain a rendering strategy output by the rendering strategy generation model.

5. The method according to claim 4, characterized in that The rendering strategy generation model is trained by the following steps: Obtaining a sample environment type and a sample rendering strategy corresponding to the sample environment type; inputting the sample environment type into an initial rendering strategy generation model; Obtaining a predicted rendering strategy output by the initial rendering strategy generation model; Calculating a model loss value according to the predicted rendering strategy and the sample rendering strategy; Adjust the model parameters of the initial rendering strategy generation model according to the model loss value, and continue to train the initial rendering strategy generation model until the model training stop condition is reached to obtain the rendering strategy generation model.

6. The method according to claim 2, characterized in that The determining, based on the environment type, a rendering strategy corresponding to the real environment includes: Based on the environment type, query the preset rendering strategy corresponding table; Get the rendering strategy corresponding to the environment type.

7. The method according to claim 6, characterized in that The rendering strategy correspondence table is obtained by the following steps: Collect ambient light information corresponding to the real environment; Based on the ambient light information, determining an environment type corresponding to the ambient light information; Based on the environment type, determining a rendering strategy corresponding to the environment type; generating a correspondence between the environment type and the rendering strategy based on the environment type and the rendering strategy corresponding to the environment type; Based on the correspondence between the environment type and the rendering strategy, the rendering strategy correspondence table is constructed.

8. The method according to claim 1, characterized in that The generating the target virtual picture based on the rendering information and the rendering strategy includes: Determining rendering sub-information to be adjusted in the rendering information; Based on the rendering strategy, adjusting the rendering sub-information to be adjusted to obtain target rendering information; Based on the target rendering information, a target virtual picture corresponding to the target rendering information is generated by rendering.

9. The method according to claim 1, characterized in that The obtaining of ambient light information of a real environment corresponding to the terminal includes: calling a photosensitive element corresponding to the terminal; The ambient light information of the real environment corresponding to the terminal is collected through the photosensitive element.

10. A rendering device, characterized in that: Applied to terminals, including: An acquisition module is configured to acquire ambient light information of a real environment corresponding to the terminal; a determination module configured to determine a rendering strategy corresponding to the real environment based on the ambient light information; The determination module is further configured to obtain a visual acuity characteristic describing a human eye, determine a correspondence between ambient light information and a rendering strategy based on the visual acuity characteristic of the human eye, and determine a rendering strategy corresponding to the real environment based on the correspondence, wherein the visual acuity characteristic is that the human eye has different sensitivities to light of different wavelengths; The generating module is configured to generate the target virtual picture based on the rendering information corresponding to the target virtual picture and the rendering strategy.

11. A computing device, characterized in that include: memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the method according to any one of claims 1 to 9.

12. A computer-readable storage medium storing computer instructions, characterized in that: When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

13. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Interface color adjustment method and apparatus, and webpage color adjustment method and apparatus

    CN107179889A

  • Improved environment light adaptive method based on tactical information terminal

    CN107358572A