Display method and device, electronic equipment and storage medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI MIHAYOULIYUE TECH CO LTD
- Filing Date
- 2021-07-14
- Publication Date
- 2026-06-23
Smart Images

Figure CN115607960B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a display method, apparatus, electronic device and storage medium. Background Technology
[0002] Currently, as users face increasing life pressures, they often relieve stress through mobile games, meaning they install game applications developed by various companies on their devices.
[0003] Before experiencing the game on a mobile device, the corresponding game resources need to be loaded, which are the objects in each scene or level of the game, such as the objects corresponding to the content displayed in each level or scene.
[0004] In practical applications, when developers create corresponding object models for in-game resources, they typically use software to color each model so that the game loads these colored models during runtime. However, real-world objects display a wide range of colors, making these colored models appear too rigid in comparison, failing to provide users with a more realistic and immersive gaming experience. Furthermore, in some scenes, the models corresponding to multiple main subjects may differ only in display effects and some details, yet developers have to create individual models for each subject according to the scene's requirements, thus imposing a significant workload on them. Summary of the Invention
[0005] This invention provides a display method, apparatus, electronic device, and storage medium to make the various parts of the target subject to be displayed more realistic when displayed, thereby improving the user experience.
[0006] In a first aspect, embodiments of the present invention provide a display method, the method comprising:
[0007] If a target subject to be displayed is detected in the current scene, the display attribute information associated with the target subject to be displayed is retrieved; wherein, the display attribute information includes at least four types of display information to be merged.
[0008] Based on the at least four types of display information to be merged, the target subject to be displayed is processed to obtain the target display information of each sub-sub-subject to be displayed in the target subject to be displayed;
[0009] Display the corresponding target sub-sub-subject based on the target display information.
[0010] Secondly, embodiments of the present invention also provide a display device, the device comprising:
[0011] The display attribute information retrieval module is used to retrieve display attribute information associated with the target subject to be displayed when the target subject to be displayed is detected in the current scene; wherein, the display attribute information includes at least four types of display information to be merged.
[0012] The target display information determination module is used to process the target subject to be displayed based on the at least four types of display information to be merged, and obtain the target display information of each sub-subject to be displayed in the target subject to be displayed;
[0013] The target sub-sub-body display module is used to display the corresponding target sub-sub-body based on the target display information.
[0014] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:
[0015] One or more processors;
[0016] Storage device for storing one or more programs.
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the display method as described in any of the embodiments of the present invention.
[0018] Fourthly, embodiments of the present invention also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the display method as described in any of the embodiments of the present invention.
[0019] The technical solution of this invention, when detecting that the current scene includes a target subject to be displayed, can retrieve the display attribute information associated with the target subject to be displayed. Based on at least four types of display information to be merged in the display attribute information, the target display information of each sub-sub ... Attached Figure Description
[0020] To more clearly illustrate the technical solutions of exemplary embodiments of the present invention, the accompanying drawings used in describing the embodiments are briefly introduced below. Obviously, the accompanying drawings described are only a portion of the drawings of the embodiments to be described in this invention, and not all of the drawings. For those skilled in the art, other drawings can be obtained from these drawings without any creative effort.
[0021] Figure 1This is a flowchart illustrating a display method provided in Embodiment 1 of the present invention;
[0022] Figure 2 This is a flowchart illustrating a display method provided in Embodiment 2 of the present invention;
[0023] Figure 3 This is a structural block diagram of a display device provided in Embodiment 3 of the present invention;
[0024] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation
[0025] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0026] Example 1
[0027] Figure 1 This is a flowchart illustrating a display method provided in Embodiment 1 of the present invention. This embodiment is applicable to situations where a computer displays objects within a loaded scene, and is particularly suitable for displaying multiple identical or different object models within a 3D game scene. The method can be executed by a display device, which can be implemented in the form of software and / or hardware. The hardware can be an electronic device, such as a mobile terminal, a PC, or a server.
[0028] like Figure 1 As shown, the method specifically includes the following steps:
[0029] S110. If the target subject to be displayed is detected in the current scene, retrieve the display attribute information associated with the target subject to be displayed.
[0030] The current scene can be a pre-built 2D or 3D game scene, such as a 3D scene built using the Unity engine to present a specific game level. Furthermore, the current scene can be triggered based on certain conditions; for example, when a level entry command is received, the corresponding resources are loaded on the terminal to present the current scene. Based on commands input from external devices, game characters within the scene can perform various operations such as moving and attacking.
[0031] The target to be displayed can be one or more object models, which can be dynamic or static, such as 3D models created by game developers using software. After creation, the object models are tagged and stored in a corresponding model library for the game to use during scene loading. Therefore, during game execution, the current scene can be detected, and the detected object models within that scene can be used as the target to be displayed.
[0032] It should be noted that, whether in the same scene or different scenes, certain object models can be called multiple times. At the same time, these object models can be displayed with different effects according to the needs of the scene. Therefore, in practical applications, the detected object models that meet the above conditions (i.e., need to be called multiple times and displayed with different effects) can also be used as the target to be displayed.
[0033] In this embodiment, each object model is also provided with corresponding display attribute information. This information can be various parameters that determine the object's display effect, such as the object's length, width, height, color, texture, position information, and material information. Those skilled in the art should understand that setting different display attribute information for the same object model can cause changes in the presented object's shape, position, material, or color. Furthermore, after these display attribute information are associated with the corresponding object model, the association results are stored in the database in the form of a mapping table. Therefore, in this embodiment, after detecting a target subject to be displayed in the current scene, the display attribute information associated with the target subject can be determined by looking up the table. It should be noted that when the same object model needs to be displayed multiple times in one scene with different display effects, or displayed separately in multiple scenes with different display effects, multiple corresponding display attribute information can also be set for the object model based on scene requirements.
[0034] In this embodiment, the display attribute information includes at least four types of display information to be merged. It can be understood that during the display process, the object model corresponding to the target subject can not only call the corresponding display information to be merged, but also use the display information to be merged as basic parameters and merge them in a superimposed manner to obtain new parameters that determine the final display effect of the object.
[0035] It should be noted that each piece of information to be merged can correspond to the whole of the target subject to be displayed, or it can correspond to a part of the target subject to be displayed. That is to say, this information to be merged can be the basic parameters of the whole object model, or it can be the basic parameters of a part of the object model. Those skilled in the art should understand that the correspondence between each piece of information to be merged and the object model should be set according to the needs of the scene for the object. This disclosure does not make specific limitations here.
[0036] For example, when a pine tree is the target subject to be displayed in the current scene, at least four colors (i.e., information to be blended and displayed) can be retrieved during the loading of the model corresponding to the pine tree. In the subsequent process, these colors can be superimposed and blended to determine the final color called by the model. In other words, the color that the pine tree will be presented to the user when loaded on the user's target client is determined.
[0037] S120. Process the target subject to be displayed based on at least four types of display information to be merged, and obtain the target display information of each sub-sub-subject to be displayed in the target subject to be displayed.
[0038] The target subject to be displayed consists of at least one sub-sub ...
[0039] In this embodiment, the process of processing the target subject to be displayed based on at least four types of display information to be fused can be understood as a process of superimposing at least four basic parameters to obtain parameters that determine the final display effect of the object in the current scene. Specifically, since the subject corresponding to the display information to be fused can be the entire object model or a part of the object model, for a specific sub-sub ...
[0040] It can be understood that the parameter information that determines the final display effect of an object after the information to be merged and processed is the target display information. For example, the target color information obtained by superimposing multiple colors. This information corresponds to each sub-sub ...
[0041] For example, in the scene, there is a pine tree model as the target subject to be displayed. The support structure corresponding to the pine tree trunk and multiple branch models are the sub-subjects to be displayed. Simultaneously, four colors, labeled 1, 2, 3, and 4, are pre-set as the display information to be merged. Colors labeled 1 and 2 correspond to the pine tree support, and colors labeled 3 and 4 correspond to the branches. Based on this, the two colors labeled 1 and 2 are superimposed to obtain the target color corresponding to the pine tree support, and the four colors labeled 1, 2, 3, and 4 are superimposed to obtain the target color corresponding to the branches.
[0042] S130. Display the corresponding target sub-sub-subject based on the target display information.
[0043] In this embodiment, after determining the target display information corresponding to each target sub-sub-subject to be displayed, this information can be called during the model display process and then displayed on the user's corresponding target client.
[0044] For example, once the pine tree is identified as the target subject to be displayed, and the pine tree support and branches as the sub-subjects to be displayed, the target display information corresponding to the pine tree support and branches can be determined. Specifically, the pine tree support corresponds to brown and gray, and the branches correspond to light green and dark green. Further, to make the pine tree in the scene more realistic when displayed, the brown and gray colors can be superimposed on the overall pine tree support to obtain the superimposed color, which will be used as the color to be retrieved during the display process. For the branches, there are also light green and dark green that uniquely correspond to them. Therefore, based on the final color of the overall pine tree support, light green and dark green need to be superimposed, that is, the above four colors are blended to obtain the color to be retrieved during the display of the branches. After this is determined, the models corresponding to the pine tree support and branches can be loaded into the current scene, colored, and displayed on the user's target client.
[0045] The technical solution of this embodiment, when detecting that the current scene includes a target subject to be displayed, can retrieve the display attribute information associated with the target subject to be displayed. Based on at least four types of display information to be merged in the display attribute information, the target display information of each sub-sub ...
[0046] Example 2
[0047] Figure 2 This is a flowchart illustrating a display method provided in Embodiment 2 of the present invention. Based on the aforementioned embodiments, during scene construction and model creation, each sub-sub-body to be displayed and at least four pieces of information to be merged for display are determined. For objects with identical parts, the operator does not need to create separate models for them, further reducing workload. Simultaneously, in the subsequent display process, the reduced number of models in the final file reduces the storage space occupied by the terminal, indirectly lowering the program's configuration requirements for the terminal. During object display, the model is loaded and the corresponding information is retrieved. The display information is then overlaid and colored, decoupling the model from the color information and allowing the computer GPU to handle some display tasks, reducing the CPU load and improving the loading efficiency of objects in the scene. This further reduces the program's requirements for device configuration and allows objects to be displayed to the user in a more realistic manner, considering grayscale, height, occlusion, shadows, and other aspects. Specific implementation methods can be found in the technical solution of this embodiment. Technical terms that are the same as or corresponding to those in the above embodiments will not be repeated here.
[0048] like Figure 2 As shown, the method specifically includes the following steps:
[0049] S210. Determine each sub-sub ...
[0050] In this embodiment, the aforementioned sub-sub-subjects and the information to be merged for display are determined during the scene building and model creation stages. For example, modeling software is used to create support models and branch models that constitute a pine tree, and corresponding texture, material, and color information are set for each model as the information to be merged for display. Those skilled in the art should understand that when displayed on the user's target client, the models of each sub-sub-subject to be displayed can be freely combined according to the needs of the scene, and this information can be retrieved according to the correspondence with the information to be merged for display. This further decouples the object structure model, reducing the workload of scene building and model creation while still being able to display objects in diverse ways.
[0051] Optionally, each sub-sub ...
[0052] In this model, each sub-sub-body to be displayed can be a face composed of at least three vertices, and this face can be a two-dimensional texture image. In practical applications, this texture image can be stored in the UV texture space during the construction of the scene and objects. When UVs serve as two-dimensional texture coordinate points residing on the vertices of a polygon mesh, a two-dimensional texture coordinate system is defined; this coordinate system is the UV texture space. Within this space, U and V are used to define the coordinate axes, determining how to place a texture image on the surface of a three-dimensional model. In other words, UVs provide a connection between the model surface and the texture image, responsible for determining which vertex on the model surface a pixel of the texture image should be placed on, thus allowing the entire texture to be overlaid onto the model.
[0053] In other words, by creating corresponding inserts in the UV texture space, it is possible to construct the face of a sub-object in the UV texture space based on at least three vertices. For the pine tree in the example above, inserts corresponding to each branch can be constructed in this way.
[0054] Simultaneously, corresponding grayscale values can be set in the vertex color of each vertex, or the corresponding grayscale values can be stored in the UV attribute of each vertex. These grayscale values correspond to the pixels of the object model, and the range is generally from 0 to 255. It can be understood that grayscale values are the "grayscale levels" obtained by pixels between black and white. Setting grayscale values for multiple pixels associated with the target object can be used to characterize the influence of environmental factors on the color presented by the target object. In other words, grayscale values can be used to adjust the brightness and saturation of the model's current base color.
[0055] One way to store the current vertex grayscale value in the UV properties is to first create a material sphere in the UV texture space using image processing tools such as Maya, then open the material sphere property editor, add a dither checkerboard texture, select the material sphere, and then click "UV Texture Editor". After the window opens, you can edit and store the grayscale values of each point corresponding to the sub-object in the "UV Texture Editor".
[0056] In this embodiment, after each sub-object to be displayed is created, it can also be stored as a texture. It can be understood that when creating an object model, many of the sub-objects to be displayed do not need to be repeatedly constructed; only the corresponding textures need to be called during the display process, further reducing the workload in the object model creation process. For example, in the same scene, when it is necessary to display pine trees and maple trees, it is only necessary to first call the support model that constitutes the tree, and then call the textures corresponding to the pine tree leaves and the maple tree leaves respectively to obtain the corresponding pine tree model and maple tree model.
[0057] For example, the leaf model can be in the form of a LUT (Look-Up Table). A LUT is a color lookup table pre-built during the construction of scene and object models. A LUT can be viewed as a function; after the color information of each pixel is repositioned by the LUT, a new color value is obtained. In this embodiment, either a 1D LUT or a 3D LUT can be used. A 1D LUT is a one-dimensional check table; each color will have a specific value after being output by the 1D LUT, but changing the input value of a certain color will only affect the output value of that color; the RGB data are independent of each other. A 3D LUT is a three-dimensional check table; a change in one input color will affect all three colors, meaning that a change in any one color will change the other colors. In practical applications, one or more colors can be pre-set as inputs in the LUT map, and the corresponding one or more output colors can be used as display color information. For example, when the leaves in the current scene are determined to be the main subject to be displayed, the color display information corresponding to the leaves can be retrieved from the corresponding LUT map.
[0058] For the target sub-subject to be displayed in the form of a texture, corresponding color display information is also set. After setting, this color display information is stored as the first display information to be blended. That is to say, the color display information stored for the texture is the base color of the sub-subject to be displayed. These base colors can be superimposed and blended with other colors (other display information to be blended) to obtain the color displayed after the texture is loaded on the target client. For the target sub-subject to be displayed in the form of a texture, there can be one or two color display information. For example, after creating a leaf texture, light green and dark green can be set as the first display information to be blended for the leaf. In this way, during the display of the leaf, the two colors can be superimposed and blended with other display information to determine the final color of the leaf.
[0059] Optionally, the top color information is stored in the vertex color and / or UV attribute information corresponding to the top of the target subject to be displayed, and the top color information is used as the second display information to be blended.
[0060] In this embodiment, to ensure a smooth transition in the height of the colors retrieved by the object model during display, top color information needs to be stored in the vertex color and / or UV attribute information corresponding to the top of the overall model of the subject to be displayed, and this information is used as the second display information to be merged. After the top color information is set during model creation, this color can be retrieved as the color to be merged for the vertices during subsequent display. Simultaneously, other pixels on the object model will also determine their corresponding colors based on this color. To create a color transition effect during model display, the farther other pixels are from the vertex, the lighter or darker their determined colors become. Those skilled in the art should understand that the setting and storage method of the top color information is similar to the setting and storage method of the first display information to be merged, and will not be described again here.
[0061] Optionally, each occluded display sub-sub ...
[0062] In certain scenarios, object models need to be displayed in a more layered manner. For example, in a game, the leaves of trees overlap. When the original color of the leaves is green, some unobstructed leaves can appear brighter in the current scene, while the obstructed leaves appear darker. Therefore, during scene construction and model creation, it is also necessary to identify the obstructing sub-objects among the multiple sub-sub ...
[0063] Specifically, the occlusion of sub-objects can be determined based on occlusion information. This occlusion information describes the occlusion status of objects in the current scene. For ease of information processing, occlusion information is represented and stored in digital form as occlusion values. The occlusion value represents the occlusion status of the sub-object in the current scene. The larger the occlusion value, the more severe the occlusion of the sub-object, and thus, a darker color needs to be displayed in the subsequent display process. Conversely, the smaller the occlusion value, the less severe the occlusion of the sub-object, and a slightly darker color needs to be displayed in the subsequent display process.
[0064] Correspondingly, for each occluded display sub-sub ...
[0065] Optionally, each shadow display sub-sub ...
[0066] In some scenarios, it's also necessary to present a contrast between light and shadow. For example, when trees are illuminated by sunlight or lamplight, some parts will appear brighter, while others will appear darker. Therefore, during scene construction and model creation, it's also necessary to identify shadow-displaying sub-objects among the multiple sub-sub ...
[0067] Optionally, determine the light source information in the current scene, and determine each shadow display sub-sub-subject in the target subject to be displayed based on the light source information.
[0068] Specifically, around each sub-subject to be displayed in the current scene, there can be a variety of light sources that can emit light. These light sources can be static or dynamic. For example, the sun in a game scene can emit sunlight, and streetlights can emit lamplight. Based on this, the light source information can be information such as the position of the light source in the scene relative to each sub-subject to be displayed, as well as its color and intensity.
[0069] Furthermore, each sub-subject to be displayed will exhibit specific effects after receiving light emitted by the light source. This can be understood as the light illuminating the model loaded in the game determining new color information. Based on this determined color information, the existing color of the sub-subject can be adjusted to produce specific lighting and shadow effects. For example, the leaves of trees in a scene appear green without a light source. When the left side of the tree is illuminated by a light source, it will appear a brighter light green, while the middle part retains its original green. Simultaneously, to enhance the display effect of the light source, the right side of the tree will appear a darker dark green. In the above example, the leaves on the left and right sides of the tree, where the color changes, are the shadow display sub-subjects. Furthermore, the shadow display color information determined by the light source information is used as the fourth display information to be merged.
[0070] It is understandable that the storage method of the fourth display information to be merged is similar to that of the first, second, and third display information to be merged, and it can also be superimposed and merged with other colors (other display information to be merged) in the subsequent display process, which will not be elaborated here.
[0071] Regarding the aforementioned scene setup and model creation stages, it is particularly important to note that each of the sub-sub ...
[0072] In the scene setup and model creation phases, identifying the sub-sub-entities to be displayed and the various information to be integrated for display has the following advantages: Based on the mechanism of further decoupling the models during resource loading, for objects with common parts, staff do not need to create separate models for them, further reducing workload. Simultaneously, in the subsequent display process, the reduced number of models in the final file reduces the amount of storage space occupied on the terminal, indirectly lowering the program's configuration requirements for the terminal.
[0073] S220. If the target subject to be displayed is detected in the current scene, retrieve the display attribute information associated with the target subject to be displayed.
[0074] In this embodiment, the current scene is a game scene, the target to be displayed subject is the object displayed in the game scene, and the at least four display information to be merged in the display attribute information include the color information to be merged. For example, when the game is running on the user's target client, the scene of a certain level loaded according to the user's instructions is the game scene; after the game scene is loaded, the game monsters, trees, and rocks in the scene are all target to be displayed subjects; the at least four colors retrieved by the game monster, tree, and rock models during the coloring process, corresponding to themselves, are the color information to be merged for each model.
[0075] Optionally, retrieve display attribute information associated with the target subject to be displayed, including:
[0076] Retrieve grayscale information from each of the target sub-sub ...
[0077] In this embodiment, since at least one target sub-sub ...
[0078] Optionally, pre-stored grayscale information can be retrieved from the vertex color or UV attribute information of each sub-sub-body to be displayed, and at least one color information to be blended corresponding to the sub-sub-body to be displayed can be retrieved from the texture. For example, for the pine tree in the current scene, pre-stored grayscale values can be directly retrieved from the vertex colors of the support model and branch model that make up the pine tree, and the base color green (the first display information to be blended) set for the leaves during the model creation process can be retrieved from the leaf texture.
[0079] Retrieve the second display information to be merged, which corresponds to the top of the target subject to be displayed. For example, for the overall model of a pine tree, the base color brown (the second display information to be merged) set for the pine tree during the model creation process can be directly retrieved from the vertex color corresponding to the top.
[0080] The occlusion display information of each sub-sub ...
[0081] The shadow display information of each sub-sub-subject to be shadowed within the target subject to be displayed is retrieved to obtain the fourth display information to be blended. For example, for leaves that produce a light and dark effect under a light source, the shadow display color set during the model creation process (the fourth display information) can be directly retrieved.
[0082] Once the above-mentioned display information to be merged has been retrieved, the display attribute information can be determined based on the first display information to be merged, the second display information to be merged, the third display information to be merged, and the fourth display information to be merged.
[0083] S230. Process the target subject to be displayed based on at least four types of display information to be merged, and obtain the target display information of each sub-sub-subject to be displayed in the target subject to be displayed.
[0084] Optionally, for each sub-sub ...
[0085] It can be understood that the first target fusion display information is the color obtained by superimposing the grayscale value and the color that is the first display information to be fused. The following is an example to illustrate this process.
[0086] In a 3D game scene, when a pine tree model is detected as the target object to be displayed, its pre-set grayscale value and the base color green, which serves as the first information to be merged for display, can be determined. Let's assume the RGB value of green is (204, 255, 204), indicating that the pine tree appears green overall. Simultaneously, in the grayscale information of the pine tree, the grayscale values of the two points corresponding to the pine tree model decrease sequentially from top to bottom, indicating that the upper part of the pine tree is lighter and the lower part is darker. Therefore, the color of each pixel on the pine tree will be adaptively adjusted according to the grayscale information. That is, the RGB values of the pixels corresponding to the points with larger grayscale values will be adjusted to light green RGB values (64, 224, 208), and the RGB values of the pixels corresponding to the points with smaller grayscale values will be adjusted to dark green RGB values (50, 205, 50). The adjusted RGB values of each pixel on the pine tree constitute the first target information for merging and displaying. The color corresponding to the first target fusion display information can be further overlaid with other colors (other target fusion display information), or it can be directly called during the object display process. If the pine tree model is loaded on the target client and the first target fusion display information is directly selected for coloring, the pine tree will appear light green in the upper half and dark green in the lower half.
[0087] Based on the second target fusion display information corresponding to the top of the target subject to be displayed and the height information of the target subject to be displayed, the second target fusion display information of each pixel in the target subject to be displayed is determined.
[0088] For example, when a pine tree is identified as the target subject to be displayed in the current scene, the color of the trunk needs to be presented in a gradient effect from top to bottom (i.e., different colors correspond to different heights of the pine tree). Branches are associated with the trunk at three positions: top, middle, and bottom. In other words, there are three sub-subjects to be displayed that are associated with the trunk. Specifically, in the 3D coordinate system constructed based on the scene, the bottom of the trunk is taken as the zero point, the coordinate axis from the bottom to the top of the trunk is taken as the Z-axis, and the height of the trunk is taken as the base height, i.e., 1 unit length. The step size of the color gradient is set to 0.01. 100 colors are selected sequentially from the green color gradation, and these colors are corresponding to the 100 heights of the trunk model divided from top to bottom according to the step size. When the height information of the three branches is 0.3, 0.6, and 0.9 respectively, it indicates that the three branches are located at positions with values of 0.3, 0.6, and 0.9 on the Z-axis. Therefore, based on the color information of different heights of the tree trunk and the height information of the three branches, it can be determined that the target display information for the branch with a Z-axis value of 0.3 is dark green, the target display information for the branch with a Z-axis value of 0.6 is standard green, and the target display information for the branch with a Z-axis value of 0.9 is light green. In other words, the color of each branch can be determined by the color of the tree trunk, and the color of each branch is consistent with the color of its location, resulting in a more natural display effect. It can be understood that, in addition to being directly used during object display, the determined colors, similar to the first target display information to be merged, can also be further superimposed with other colors.
[0089] Based on the third target display information of each sub-sub ...
[0090] For example, in the current scene, one or more leaves on a branch are occluded, and these leaves can be used as the main subject to be displayed. The base color of the leaves can be adjusted based on pre-set occlusion values and shadow display information. Specifically, the base color of the leaf texture is determined to be light green, the occlusion color information is gray, and the occlusion value is 90 (pre-set occlusion values are between 0 and 100, where 0 represents the lowest occlusion value and 100 represents the highest occlusion value; simultaneously, a mapping table representing the correspondence between occlusion values and the adjustment ratio of occlusion color information is pre-stored in the database). This indicates that the leaf is severely occluded in the current scene and needs to be displayed with a darker color. Therefore, based on the occlusion value, the adjustment ratio of the occlusion color information of the leaf texture can be determined by looking up the table. That is, a color close to black is selected proportionally from the gray color level. Then, this determined color is blended with the already determined light green display color information of the leaf texture to determine the corresponding color of the leaf texture, which is then used as the third display information to be blended. It is understandable that, in addition to being directly called during the object display process, the determined color can also be further superimposed with other colors, similar to the first target display information to be merged and the second target display information to be merged.
[0091] Based on the fourth target display information of each shadow display sub-sub ...
[0092] For example, the base color of the leaves is determined to be green. In the light source information, the light source color is white, and the light intensity is 300 lx. Based on the light source information, new RGB values (i.e., shadow display information) can be determined for the sub-sub-model under illumination and in shadow. By superimposing the green RGB value with the determined new color RGB value, the leaves under illumination and the leaves in shadow can respectively determine light green and dark green RGB values, and the determined color is used as the fourth display information to be merged. It can be understood that, in the object display process, in addition to being directly called, the determined color, similar to the first, second, and third target display information to be merged, can also be further superimposed with other colors.
[0093] In this embodiment, by overlaying the first target fusion display information, the second target fusion display information, the third target fusion display information, and the fourth target fusion display information, the target display information of each sub-sub ...
[0094] For example, the target subject to be displayed in the current scene is a pine tree, and the sub-subjects to be displayed are the trunk, branches, and leaves. Simultaneously, based on the grayscale values corresponding to the trunk and branch models constituting the pine tree, and the first target display information to be blended, the overall color of the pine tree can be determined, and this color is used as the first target display information to be blended. Based on the second target display information corresponding to the top of the pine tree and the height information of the pine tree, the colors of the trunk and branches at various positions on the trunk can be determined, and this color is used as the second target display information to be blended. Based on the third target display information of the leaves to be occluded, the color of the occluded leaves in the current scene can be determined, and this color is used as the third target display information to be blended. Based on the fourth target display information of the leaves under the shadows (generated by light sources in the scene) on the pine tree, the color of the leaves under the shadows can be determined, and this color is used as the fourth target display information to be blended. Furthermore, for the different parts that make up the pine tree (i.e., the models corresponding to multiple sub-sub ...
[0095] It should be noted that in this embodiment, the superposition process of the above-mentioned at least four types of target fusion display information is not strictly limited in order; at the same time, as can be seen from the above examples, the superposition of colors should be based on the corresponding sub-sub-body to be displayed. That is to say, the number of colors corresponding to different sub-sub-body to be displayed as target fusion display information is not the same, and each sub-sub-body to be displayed only selects the color corresponding to itself for superposition processing.
[0096] S240. Display the corresponding target sub-sub-subject based on the target display information.
[0097] The technical solution of this embodiment determines each sub-sub-subject to be displayed and at least four pieces of information to be merged and displayed during the scene construction and model creation process. For objects with some common parts, the staff does not need to create separate models for them, further reducing the workload. At the same time, in the subsequent display process, the final file can reduce the occupation of terminal storage space due to the reduction in the number of models, indirectly reducing the program's configuration requirements for the terminal. During the object display process, the model is loaded and the corresponding information is retrieved. The display information is superimposed and then colored. This not only decouples the model from the color information, but also allows the computer GPU to undertake part of the display task, reducing the CPU load, improving the loading efficiency of objects in the scene, further reducing the program's requirements for device configuration, and at the same time, it allows objects to be displayed to the user in a more realistic form in terms of grayscale, height, occlusion, shadows, and other aspects.
[0098] Example 3
[0099] Figure 3 This is a structural block diagram of a display device provided in Embodiment 3 of the present invention. It can execute the display method provided in any embodiment of the present invention, and possesses the corresponding functional modules and beneficial effects for executing the method. For example... Figure 3 As shown, the device specifically includes: a display attribute information retrieval module 310, a target display information determination module 320, and a target sub-sub-body display module 330.
[0100] The display attribute information retrieval module 310 is used to retrieve display attribute information associated with the target subject to be displayed when the current scene is detected to include a target subject to be displayed; wherein the display attribute information includes at least four types of display information to be merged.
[0101] The target display information determination module 320 is used to process the target subject to be displayed based on the at least four types of display information to be merged, and obtain the target display information of each sub-sub-subject to be displayed in the target subject to be displayed.
[0102] The target sub-sub-body display module 330 is used to display the corresponding target sub-sub-body based on the target display information.
[0103] Based on the above technical solutions, the display attribute information retrieval module 310 includes a first display information retrieval unit to be merged, a second display information retrieval unit to be merged, a third display information retrieval unit to be merged, a fourth display information retrieval unit to be merged, and a display attribute information determination unit.
[0104] The first display information retrieval unit is used to retrieve grayscale information and first display information to be merged with the corresponding sub-sub ...
[0105] The second display information retrieval unit is used to retrieve the second display information to be merged corresponding to the top of the target display subject.
[0106] The third unit for retrieving display information to be merged is used to retrieve the occlusion display information of each occluded sub-sub ...
[0107] The fourth display information retrieval unit is used to retrieve the shadow display information of each shadow display sub-sub ...
[0108] The display attribute information determination unit is used to determine the display attribute information based on the first display information to be merged, the second display information to be merged, the third display information to be merged, and the fourth display information to be merged; wherein, the sub-sub-body to be displayed includes a display sub-body to be occluded and a display sub-body to be shadowed.
[0109] Optionally, the first display information retrieval unit is further configured to retrieve pre-stored grayscale information from the vertex color or UV attribute information of each sub-sub-body to be displayed, and retrieve at least one color information to be merged with the sub-sub-body to be displayed from the texture; wherein the first display information to be merged includes at least one color information.
[0110] Based on the above technical solutions, the target display information determination module 320 includes a first target fusion display information determination unit, a second target fusion display information determination unit, a third target fusion display information determination unit, a fourth target fusion display information determination unit, and a target display information determination unit.
[0111] The first target fusion display information determination unit is used to determine the grayscale information of the current sub-sub ...
[0112] The second target fusion display information determination unit is used to determine the second target fusion display information of each pixel in the target subject to be displayed based on the second target fusion display information corresponding to the top of the target subject to be displayed and the height information of the target subject to be displayed.
[0113] The third target fusion display information determination unit is used to determine the third target fusion display information of each pixel in each occluded sub-sub ...
[0114] The fourth target fusion display information determination unit is used to determine the fourth target fusion display information of corresponding pixels in each shadow display sub-sub ...
[0115] The target display information determination unit is used to obtain the target display information of each sub-sub ...
[0116] Based on the above technical solutions, the display device also includes an information determination module.
[0117] The information determination module is used to determine each sub-sub ...
[0118] Based on the above technical solutions, the information determination module includes a first unit for determining information to be merged and displayed, a second unit for determining information to be merged and displayed, a third unit for determining information to be merged and displayed, and a fourth unit for determining information to be merged and displayed.
[0119] The first unit for determining display information to be merged is used to determine each sub-sub ...
[0120] The second unit for determining display information to be merged is used to store top color information in the vertex color and / or UV attribute information corresponding to the top of the target subject to be displayed, and to use the top color information as the second display information to be merged.
[0121] The third unit for determining display information to be merged is used to determine each occluded sub-sub ...
[0122] The fourth unit for determining display information to be merged is used to determine each shadow display sub-sub ...
[0123] Optionally, the fourth unit for determining information to be merged is also used to determine the light source information in the current scene, and to determine each shadow display sub-sub-subject in the target subject to be displayed based on the light source information.
[0124] Based on the above technical solutions, the current scene is a game scene, the target subject to be displayed is the object displayed in the game scene, and the information to be merged and displayed includes the color information to be merged and displayed.
[0125] The technical solution provided in this embodiment, when detecting that the current scene includes a target subject to be displayed, can retrieve the display attribute information associated with the target subject to be displayed. Based on at least four types of display information to be merged in the display attribute information, the target display information of each sub-sub ...
[0126] The display device provided in the embodiments of the present invention can execute the display method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0127] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of the present invention.
[0128] Example 4
[0129] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Figure 4 A block diagram is shown of an exemplary electronic device 40 suitable for implementing embodiments of the present invention. Figure 4 The electronic device 40 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0130] like Figure 4 As shown, electronic device 40 is represented in the form of a general-purpose computing device. The components of electronic device 40 may include, but are not limited to: one or more processors or processing units 401, system memory 402, and bus 403 connecting different system components (including system memory 402 and processing unit 401).
[0131] Bus 403 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0132] Electronic device 40 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 40, including volatile and non-volatile media, removable and non-removable media.
[0133] System memory 402 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 404 and / or cache memory 405. Electronic device 40 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 406 may be used to read and write non-removable, non-volatile magnetic media (… Figure 4 Not shown; usually referred to as a "hard drive"). Although Figure 4 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 403 via one or more data media interfaces. Memory 402 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0134] A program / utility 408 having a set (at least one) of program modules 407 may be stored, for example, in memory 402. Such program modules 407 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 407 typically perform the functions and / or methods described in the embodiments of the present invention.
[0135] Electronic device 40 can also communicate with one or more external devices 409 (e.g., keyboard, pointing device, display 410, etc.), and with one or more devices that enable a user to interact with the electronic device 40, and / or with any device that enables the electronic device 40 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 411. Furthermore, electronic device 40 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 412. As shown, network adapter 412 communicates with other modules of electronic device 40 via bus 403. It should be understood that, although... Figure 4Not shown, other hardware and / or software modules may be used in conjunction with electronic device 40, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0136] The processing unit 401 executes various functional applications and data processing by running programs stored in the system memory 402, such as implementing the display method provided in the embodiments of the present invention.
[0137] Example 5
[0138] Embodiment 5 of the present invention also provides a storage medium containing computer-executable instructions, which are used to perform a display method when executed by a computer processor.
[0139] The method includes:
[0140] If a target subject to be displayed is detected in the current scene, the display attribute information associated with the target subject to be displayed is retrieved; wherein, the display attribute information includes at least four types of display information to be merged.
[0141] Based on the at least four types of display information to be merged, the target subject to be displayed is processed to obtain the target display information of each sub-sub-subject to be displayed in the target subject to be displayed;
[0142] Display the corresponding target sub-sub-subject based on the target display information.
[0143] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0144] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable project code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit programs for use by or in connection with an instruction execution system, apparatus, or device.
[0145] The project code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0146] Computer project code for performing the operations of embodiments of the present invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The project code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0147] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A display method, characterized in that, include: If a target subject to be displayed is detected in the current scene, the display attribute information associated with the target subject to be displayed is retrieved; wherein, the display attribute information includes at least four types of display information to be merged. Based on the at least four types of display information to be merged, the target subject to be displayed is processed to obtain the target display information of each sub-sub-subject to be displayed in the target subject to be displayed; Display the corresponding target sub-sub-body to be displayed based on the target display information; The step of retrieving display attribute information associated with the target subject to be displayed includes: Retrieve grayscale information from each sub-sub ... Retrieve the second display information to be merged corresponding to the top of the target subject to be displayed; The occlusion display color information of each sub-sub ... Retrieve the shadow display color information of each shadow display sub-sub ... Based on the first display information to be merged, the second display information to be merged, the third display information to be merged, and the fourth display information to be merged, the display attribute information is determined. The sub-sub ... Before retrieving the display attribute information associated with the target subject to be displayed, the method further includes: Each sub-sub ... The top color information is stored in the vertex color and / or UV attribute information corresponding to the top of the target subject to be displayed, and the top color information is used as the second display information to be fused. Each occluded sub-sub ... Each shadow display sub-sub ...
2. The method according to claim 1, characterized in that, The step of retrieving grayscale information from each sub-sub ... Retrieve pre-stored grayscale information from the vertex color or UV attribute information of each sub-sub-body to be displayed, and retrieve at least one color information to be blended corresponding to the sub-sub-body to be displayed from the texture.
3. The method according to claim 1, characterized in that, The process of processing the target subject to be displayed based on the at least four types of display information to be merged, to obtain the target display information of each sub-subject to be displayed in the target subject to be displayed, includes: For each sub-sub-body to be displayed, determine the grayscale information of the current sub-sub-body to be displayed, and determine the grayscale value of each pixel in the current sub-sub-body to be displayed based on the grayscale information. Based on the grayscale value and the first display information to be fused, obtain the first target fusion display information of each pixel in the sub-sub-body to be displayed. Based on the second target fusion display information corresponding to the top of the target subject to be displayed and the height information of the target subject to be displayed, the second target fusion display information of each pixel in the target subject to be displayed is determined; Based on the third display information to be merged for each of the sub-sub ... Based on the fourth display information to be merged for each shadow display sub-sub ... By overlaying the first target fusion display information, the second target fusion display information, the third target fusion display information, and the fourth target fusion display information, the target display information of each sub-sub ...
4. The method according to claim 1, characterized in that, The step of determining each shadow display sub-sub-subject in the target subject to be displayed includes: Determine the light source information in the current scene, and determine each shadow display sub-sub-subject in the target subject to be displayed based on the light source information.
5. The method according to any one of claims 1-4, characterized in that, The current scene is a game scene, the target subject to be displayed is the object displayed in the game scene, and the information to be merged includes the color information to be merged.
6. A display device, characterized in that, include: The display attribute information retrieval module is used to retrieve display attribute information associated with the target subject to be displayed when the target subject to be displayed is detected in the current scene; wherein, the display attribute information includes at least four types of display information to be merged. The target display information determination module is used to process the target subject to be displayed based on the at least four types of display information to be merged, and obtain the target display information of each sub-subject to be displayed in the target subject to be displayed; The target sub-sub-body display module is used to display the corresponding target sub-body based on the target display information; The display attribute information retrieval module includes: The first display information retrieval unit is used to retrieve grayscale information from each sub-sub ... The second display information retrieval unit is used to retrieve the second display information to be merged corresponding to the top of the target display subject; The third display information retrieval unit is used to retrieve the occlusion display color information of each occluded display sub-sub ... The fourth display information retrieval unit is used to retrieve the shadow display color information of each shadow display sub-sub ... The display attribute information determination unit is used to determine the display attribute information based on the first display information to be merged, the second display information to be merged, the third display information to be merged, and the fourth display information to be merged. The sub-sub ... The device further includes an information determination module, the information determination module comprising: The first unit for determining display information to be merged is used to determine each sub-sub ... The second display information determination unit is used to store top color information in the vertex color and / or UV attribute information corresponding to the top of the target display subject, and to use the top color information as the second display information to be merged. The third unit for determining display information to be merged is used to determine each occluded sub-sub ... The fourth unit for determining display information to be merged is used to determine each shadow display sub-sub ...
7. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the display method as described in any one of claims 1-5.
8. A storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the display method as described in any one of claims 1-5.