Method, apparatus, electronic device and storage medium for determining display information
By detecting the attributes and light source information of the target subject, and retrieving and overlaying the sub-subject attributes, the problem of poor performance of game models under light sources was solved, improving the user experience and optimizing the model creation process.
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-07-31
AI Technical Summary
In existing technologies, game models are difficult to display the effect of alternating light and dark under light sources, resulting in a user experience that is not close to reality. Furthermore, models need to be repeatedly created to achieve different display effects, which increases the workload of developers.
By detecting the attribute information and light source information of the target subject, the attribute information of the sub-subject to be displayed and the sub-subject to be distinguished are retrieved respectively, and then superimposed during the display process to achieve the decoupling of the model, so that it presents a light and dark effect under the light source.
It improves user experience, reduces the tedious process of model creation, lowers device configuration requirements, and improves object loading efficiency.
Smart Images

Figure CN115607964B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, apparatus, electronic device and storage medium for determining display information. 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, the effects displayed by these colored models are fixed. When the loaded scene contains light sources, the models struggle to display varying degrees of light and shadow, failing to provide users with a more realistic and natural sensory experience. Furthermore, in some scenes, the models corresponding to multiple subjects may differ only in display effects and some details, yet developers must 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 method, apparatus, electronic device, and storage medium for determining display information, so that different parts of the target subject present a light and dark effect under a light source, thereby improving the user experience.
[0006] In a first aspect, embodiments of the present invention provide a method for determining display information, the method comprising:
[0007] When a target subject is detected in the current scene, the target attribute information of each sub-sub ...
[0008] Each sub-subject to be displayed is displayed based on the target attribute information, and the sub-subject to be distinguished is superimposed based on the distinguishing display attribute information.
[0009] Secondly, embodiments of the present invention also provide an apparatus for determining display information, the apparatus comprising:
[0010] The retrieval module is used to retrieve target attribute information of each sub-sub ...
[0011] The display module is used to display each sub-sub-subject to be displayed based on the target attribute information, and to overlay the sub-sub-subject to be distinguished based on the distinguishing display attribute information.
[0012] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:
[0013] One or more processors;
[0014] Storage device for storing one or more programs.
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining display information as described in any embodiment of the present invention.
[0016] 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 a method for determining display information as described in any of the embodiments of the present invention.
[0017] The technical solution of this invention, when detecting that the current scene includes a target subject, can retrieve the target attribute information of each sub-sub ... Attached Figure Description
[0018] 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.
[0019] Figure 1This is a flowchart illustrating a method for determining display information provided in Embodiment 1 of the present invention;
[0020] Figure 2 This is a flowchart illustrating a method for determining display information provided in Embodiment 2 of the present invention;
[0021] Figure 3 This is a flowchart illustrating a method for determining display information provided in Embodiment 3 of the present invention;
[0022] Figure 4 This is a structural block diagram of a device for determining display information provided in Embodiment 4 of the present invention;
[0023] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. Detailed Implementation
[0024] 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.
[0025] Example 1
[0026] Figure 1 This is a flowchart illustrating a method for determining display information 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 applicable to scenes displaying multiple identical or different object models within a 3D game scene. This method can be executed by a device for determining display information, 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.
[0027] To clearly explain the technical solution of this embodiment, we can take a game running on a terminal as an example to first introduce the application scenario of this embodiment. First, users can install the app corresponding to the game on a terminal, such as a PC or a mobile terminal. With the widespread use of mobile terminals, this is more applicable to mobile games. During game operation, corresponding resources need to be loaded in real time. For example, when running a 3D game, specific game scenes and objects need to be loaded according to the current game screen. The scene can be the scene corresponding to certain levels or dungeons, and the objects can be trees, rocks, or clouds within the scene. Therefore, developers need to construct scene and object models during game development.
[0028] During game development, developers can use various software to create and color object models. For example, they can edit a 3D model in a CAD editor and then color it by clicking the object color option in the view. However, the effects displayed by these colored object models are often too rigid. When the loaded scene contains light sources, the model struggles to achieve a balanced interplay of light and shadow. For instance, a tree model in a game, after being colored with a specific color, will display with a fixed effect in any scene. However, in real-world scenes, under sunlight or artificial light, some parts of the tree will appear brighter, while others will appear darker. When loading such a game scene on a terminal, users expect objects like the trees in the scene to display with a more realistic effect.
[0029] On the other hand, during game execution, the same object may need to be displayed with different effects in different scenes. For example, in scene 1, the branches and leaves of trees need to be green, while in scene 2, only branches need to be present on the trees, and they need to be yellow. Developers hope to effectively avoid the workload of creating different display effect models according to scene requirements. Therefore, this embodiment is implemented in a scenario where the above-mentioned requirements exist.
[0030] like Figure 1 As shown, the method specifically includes the following steps:
[0031] S110. When a target subject is detected in the current scene, retrieve the target attribute information of each sub-sub ...
[0032] 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.
[0033] In this embodiment, the target subject 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 serve as the target subject.
[0034] It should be noted that certain object models can be called multiple times, whether in the same scene or different scenes. 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 subjects.
[0035] In this embodiment, the target subject includes at least one sub-sub ...
[0036] Correspondingly, for each sub-subject to be displayed, the corresponding target attribute information can be retrieved. This information is used to characterize the attributes possessed by the sub-subject itself, including various parameters that determine the display effect of the sub-subject, such as the length, width, height, texture, position information, and material information of the sub-subject. Those skilled in the art should understand that different target attribute information can allow the sub-subject to be displayed to be presented with various shapes, materials, or colors at different positions of the target subject. Simultaneously, the target attribute information can be associated with the corresponding sub-subject to be displayed, and the association result is stored in the database in the form of a mapping table. Therefore, in this embodiment, after detecting the target subject and determining the sub-subject to be displayed, the target attribute information corresponding to the sub-subject to be displayed can be determined by looking up a table. It should be noted that when the sub-subject to be displayed needs to be displayed multiple times in one scene with different display effects, or displayed separately in multiple scenes with different display effects, multiple target attribute information corresponding to the sub-subject to be displayed can also be set based on scene requirements.
[0037] In practical applications, in order to make different parts of objects in the scene present a light and dark effect under the light source, it is necessary to further divide and process the sub-subjects to be displayed. Therefore, the sub-subjects to be displayed also include the sub-subjects to be distinguished. The sub-subjects to be distinguished are explained below.
[0038] The sub-sub-body to be distinguished and displayed can be a model that belongs to the sub-sub-body to be displayed in terms of model structure and is associated with the sub-sub-body to be displayed in terms of model position, such as a model of leaves on a tree branch.
[0039] For the sub-subject to be distinguished and displayed, there is also distinguishable display attribute information, which is determined based on the light source information in the target scene.
[0040] Specifically, around the sub-subject to be distinguished 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 the sub-subject to be distinguished, as well as its color and intensity.
[0041] Furthermore, the sub-subject to be differentiated 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 the differentiation attribute information (i.e., various parameter information). Based on this differentiation attribute information, the existing parameter information of the sub-subject to be differentiated can be adjusted to produce specific lighting 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 whose colors change are the sub-subjects to be differentiated. The differentiation attribute information consists of various parameter information that affects the display effect of the sub-subject under the light source, and this parameter information is determined by the light source information. It should be noted that, similar to the target attribute information, after determining the differentiation information based on the light source information in the target scene, the differentiation information can also be associated with the target scene and the identifier of the sub-subject to be differentiated, and stored in the database in the form of a mapping table, to be retrieved when the target subject in the current scene is detected.
[0042] Corresponding to the sub-subjects to be distinguished and displayed, the sub-subjects to be displayed also include those not to be distinguished and displayed. These sub-subjects do not have distinguishing display attribute information, but are displayed directly based on their associated parameter information, meaning they are not affected by the light source in the scene. In the example above, the middle part of the tree whose color does not change is the non-distinguished sub-subject.
[0043] S120. Display each sub-subject to be displayed based on the target attribute information, and overlay the sub-subjects to be distinguished based on the distinguishing display attribute information.
[0044] In this embodiment, after retrieving the target attribute information corresponding to the sub-subject to be displayed, the sub-subject to be displayed can be displayed directly based on this information. For example, after retrieving the color information of the tree trunk and branches in the current scene, it can be determined that the tree trunk and branches are brown and green respectively. During the display process, for the part corresponding to the tree, the above colors can be directly called for display.
[0045] It should be noted that non-distinguished sub-sub ...
[0046] In this embodiment, after retrieving the target attribute information corresponding to the sub-sub-body to be displayed, the basic parameter information to be adjusted is determined for the sub-sub-body to be distinguished. For example, when the color information of the branch is determined to be green, the leaves of the sub-sub-body to be distinguished, which is the branch, will also be green as the basic color to be adjusted.
[0047] Furthermore, the retrieved distinguishing display attribute information can be overlaid with the basic parameter information to be adjusted. For example, if the basic color of a leaf is determined to be green, and the light source information shows that the light source color is white and the light intensity is 300 lx, a new color RGB value (i.e., distinguishing display attribute information) can be determined based on the light source information. By overlaying the green RGB value with the determined new color RGB value, the light green RGB value can be determined, and light green can be used as the target display color of the leaf. In other words, the leaf, as the subject to be distinguished, will ultimately use light green as the color during the display process.
[0048] It should also be noted that, for the sub-subject to be distinguished and displayed, the target attribute information is not necessarily used as the basic parameter information to be adjusted. Those skilled in the art should understand that, during the creation of the relevant models of the sub-subject to be distinguished and displayed, the basic parameter information to be adjusted can also be preset for these models, so that after retrieving the distinguishing display attribute information, the preset parameter information can be directly adjusted. That is to say, the specific method of defining the basic parameter information of the sub-subject to be distinguished and displayed is selected according to the actual situation, and the embodiments of this disclosure do not make specific limitations here.
[0049] The technical solution of this embodiment, when detecting that the current scene includes a target subject, can retrieve the target attribute information of each sub-sub-subject to be displayed, as well as the distinguishing display attribute information of the sub-sub-subject to be distinguished based on the light source information. Then, based on the above information, it displays each sub-sub-subject to be displayed and the sub-sub-sub-subject to be distinguished. During the scene loading process, the target subject is decoupled and split, so that each part of the target subject presents a light and dark effect under the light source, which improves the user experience. At the same time, during the scene building process, it avoids the tedious process of creating models multiple times for subjects that only differ in real-world information or some details.
[0050] Example 2
[0051] Figure 2This is a flowchart illustrating a method for determining display information 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 each sub-sub-body to be distinguished are created. During loading, multiple sub-sub-body groups are combined to form the target body, determining the corresponding target attribute information and distinguishable display attribute information. This information is stored in vertex colors, UV attributes, or LUT textures. This not only decouples the model from color information but also allows the computer GPU to undertake some display tasks, reducing the CPU load, improving the loading efficiency of objects in the scene, and further reducing the program's requirements for device configuration. Specific implementation details 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.
[0052] like Figure 2 As shown, the method specifically includes the following steps:
[0053] S210. Determine the target subject to be displayed in each scene; determine the target attribute information of each sub-subject to be displayed in each target subject to be displayed, as well as the distinguishing display attribute information of the sub-subject to be distinguished.
[0054] During scene construction and model creation, corresponding object models can be associated with different scenes. These associated object models can be understood as the main target to be displayed for each scene. For example, in a game level marked 1, there might be a pine tree. After the pine tree model is created, it needs to be associated with that level for loading during game execution. In this case, the pine tree model can serve as the main target to be displayed for level 1. It should be noted that the main target to be displayed can consist of multiple sub-targets. In the example above, the pine tree model could be composed of models of the trunk, branches, and leaves.
[0055] In this embodiment, after associating the target subject to be displayed with the corresponding scene, it is also necessary to determine the target attribute information of the sub-subject to be displayed, as well as the distinguishing display attribute information of the sub-subject to be distinguished. This step can be understood as the process of pre-setting and determining the parameter information of each model when building the scene.
[0056] For example, the color information of the tree trunk and branches is set to brown and green respectively. At the same time, based on the light source information in the scene, the distinguishable display information of the leaves of the tree that need to be displayed differently due to the light is determined to be gray.
[0057] S220. Store the target attribute information and the distinguishable display attribute information in the target storage location so that when the target subject is detected in the current scene, the target attribute information and the distinguishable display attribute information corresponding to the target subject can be retrieved from the target storage location.
[0058] The target storage location includes vertex color, UV attribute, or LUT texture. The three storage methods are explained below.
[0059] For the sub-sub ...
[0060] In this embodiment, when the sub-object to be displayed is composed of multiple vertices, it can also be used as a two-dimensional texture image. During scene construction and model creation, this texture image can be stored in the UV texture space. 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 coordinate axes to determine how to place a texture image on the three-dimensional model surface. That is, 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, thereby allowing the entire texture to be overlaid onto the model. Based on this, a second storage method can be obtained: after determining the target attribute information or distinguishing display attribute information of the sub-object, this information is stored in the UV attributes of each vertex for retrieval during the display of the sub-object. The specific storage process is as follows: First, use image processing tools such as Maya to create a material sphere in UV texture space. Then, open the material sphere attribute 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 attribute information of each point corresponding to the sub-object in the "UV Texture Editor".
[0061] During scene setup and model creation, a color lookup table (LUT) can be pre-built. 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. Based on this, a third storage method can be derived: pre-setting one or more colors as input in the LUT texture and using the corresponding one or more output colors as target attribute information or distinguishing display attribute information. For example, when creating a tree branch model as a sub-body to be displayed in the form of an interpolation piece, green can be set as the base color (i.e. target attribute information) in the pre-built LUT texture. When there are two base colors, green and yellow, the position information corresponding to each color can be combined to make green correspond to the left half of the tree branch and yellow correspond to the right half of the tree branch.
[0062] The advantages of storing target attribute information or distinguishing display attribute information in vertex color, UV attributes, or LUT textures are: it not only decouples the model from color information, but also allows the computer GPU to undertake some display tasks, reducing the CPU load, improving the loading efficiency of objects in the scene, and further reducing the program's requirements for device configuration.
[0063] S230. When a target subject is detected in the current scene, retrieve the target attribute information of each sub-sub ...
[0064] S240. Display each sub-subject to be displayed based on the target attribute information, and overlay the sub-subjects to be distinguished based on the distinguishing display attribute information.
[0065] In this embodiment, during scene building and model creation, each sub-sub-body to be displayed and each sub-sub-body to be distinguished are created separately. During the loading process, multiple sub-sub-body combinations form the target body, and the corresponding target attribute information and distinguishable display attribute information are determined. This information is then stored in vertex color, UV attributes, or LUT textures. This not only decouples the model from 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, and further reducing the program's requirements for device configuration.
[0066] Example 3
[0067] Figure 3 This is a flowchart illustrating a method for determining display information according to Embodiment 3 of the present invention. Based on the aforementioned embodiments, the method determines the target sub-sub ...
[0068] like Figure 3 As shown, the method specifically includes the following steps:
[0069] S310. Determine the target subject to be displayed in each scene, and the subject color information of the target subject to be displayed.
[0070] The primary color information can be the RGB values stored in the vertex color, UV attributes, or LUT texture during model creation, representing the color of the target subject to be displayed. For each target subject to be displayed, the primary color information can include one color or multiple colors. For example, in the model library corresponding to the 3D game scene mentioned above, for the pine tree model, the RGB values corresponding to brown and dark green are pre-stored, and the corresponding position information of the two colors on the object model is combined as the primary color information. For the maple tree model, the RGB values corresponding to brown and red are pre-stored, and the corresponding position information of the two colors on the object model is combined as the primary color information. Based on this, if the game only calls the primary color information of the pine and maple trees during operation, the pine tree will display brown on the trunk and dark green on the leaves, and the maple tree will display brown on the trunk and red on the leaves.
[0071] S320. Determine the sub-sub-subjects to be distinguished in the target subject to be displayed, and the distinguishing display attribute information of the sub-sub-sub-subjects to be distinguished, based on the light source information in the scene.
[0072] The light source information includes the number of light sources, the intensity of the light sources, and / or the relative angle between the light sources and the target sub-sub-body to be displayed.
[0073] Specifically, one or more light sources can exist in different scenarios. For example, in a 3D game scene, in addition to the sun, multiple light sources can be created. When creating each light source in the scene, light source intensity information can also be set. The light source intensity information is used to indicate the intensity of the light and the degree to which the surface of the object model in the scene is illuminated. For example, in a certain level of the game, the light source marked as 1 has a lux value of 300. For each light source, its light source intensity information can be fixed or can be adaptively changed according to the instructions issued or triggered by the user in the scene. This disclosure does not impose specific limitations on this embodiment.
[0074] For the light source and the target subject to be displayed, their relative angle can be determined based on their positional relationship in three-dimensional space. Specifically, during scene construction, a three-dimensional coordinate system can be pre-constructed in the scene, centered on the light source whose relative angle with the target subject needs to be determined. Within this coordinate system, the target subject locates its position based on the three-dimensional coordinates of at least one point on the model. Furthermore, based on the spatial coordinate information of the target subject, the relative angle between the subject and the light source can be determined. For example, by constructing a three-dimensional coordinate system centered on the sun in the game scene, and determining the spatial coordinates of the tree branch that serves as the target subject, the two points can be connected. The angle between this line segment and the x-axis, y-axis, and z-axis of the three-dimensional coordinate system represents the relative angle between the two. It should be noted that when there are other light sources in the scene, the target sub-sub-body to be displayed can also determine the relative angle with other light sources in the same way as described above. That is, with each other light source as the center, determine the angle between the line connecting the target sub-sub-body to be displayed and these light sources and the x-axis, y-axis and z-axis in the corresponding coordinate system, and then obtain the relative angle information.
[0075] Those skilled in the art should understand that, in practical applications, on the one hand, when the target sub-subject to be displayed in the scene is a dynamic object model, as the target sub-subject to be displayed moves, the number of light sources, the intensity of the light sources, and the relative angle with at least one light source corresponding to the object model can also adaptively change based on a preset function in the current scene. For example, in a game scene, after multiple leaves drift from point A to point B in the scene, they change from being illuminated by the sun and two lights to being illuminated only by the sun. Therefore, the number of light sources changes from 3 to 1, the intensity of the light sources changes from 300 lx to 100 lx, and at the same time, as the spatial position information of the leaves changes, the relative angle with the sun will also adaptively change.
[0076] On the other hand, even within the same scene, the number of light sources, their intensity, and / or the relative angles between the light sources and the main subject being displayed differ for different object models. For example, in a game scene, the branch inserts are illuminated by both sunlight and artificial light, while the stone model is only illuminated by sunlight. Therefore, the number of light sources differs between the two. The branch receives sunlight and artificial light, resulting in a higher lux value than the stone model. Furthermore, due to their different spatial positions, the relative angles between the branch inserts and the stone model and the sun are also different.
[0077] Optionally, based on the number of light sources, the intensity of the light sources, and / or the relative angle between the light sources and the target sub-sub ...
[0078] In this embodiment, the number of light sources, the intensity of the light sources, and / or the relative angle between the light sources and the target sub-subject to be displayed are three factors affecting the display effect of the object model. This can be understood as meaning that the aforementioned light-related factors can all affect the display effect of the model (such as the color information that the model can access during display). For example, for a tree branch model in the form of an interlocking element within the scene, when the base color to be adjusted is determined to be green, combined with the aforementioned light-related factors, the RGB value of green can be further changed to obtain a new color, thereby making the tree exhibit a contrasting effect of light and shadow under the illumination of the light source. Based on this, it can be determined that the sub-subject to be distinguished and displayed can be a model of an object in the current scene affected by the aforementioned light-related factors, and is determined by these factors.
[0079] It is particularly important to note that, for object models illuminated by light sources, in order to make the final display effect closer to reality, the model in the backlight can also be identified as the sub-subject to be distinguished and displayed. Correspondingly, under the influence of the above factors, the dark color information of the model in the backlight can be determined. The dark color information can be understood as the darker color information determined after processing the base color to be adjusted of the object model in the backlight, such as the RGB value of gray or black.
[0080] For example, for multiple branch insert models constituting a tree, the base color to be adjusted is green. When the light source shines from the left side of the tree, color adjustment parameters can be determined based on three light-related factors. The left side of the tree adjusts its base color according to the color adjustment parameters to present a brighter light green. To highlight the effect of alternating light and dark, for the right side of the tree that is not illuminated by the light source, the green corresponding to the right branch can also be adjusted based on the three light-related factors to determine the RGB value corresponding to the dark green as dark color information, which will be called when the model is loaded and displayed. At the same time, in order to make the color transition from the left to the right side of the tree more natural, the branch model in the middle of the tree retains its base color. That is to say, compared with the left and right sub-sub ...
[0081] S330. When at least one target subject is detected in the current scene, retrieve the target attribute information corresponding to each target subject and the distinguishing display attribute information of the sub-subject to be distinguished.
[0082] In this embodiment, there can be one or more target subjects in the current scene. When there are multiple target subjects, the subject color information of each target subject can be retrieved. At the same time, for each target subject, the distinguishing display attribute information of the sub-subjects to be distinguished can also be retrieved.
[0083] For example, when the target subjects in the scene are pine trees and maple trees, the main color information of the trees, green and red, can be retrieved respectively. At the same time, since both trees are illuminated by sunlight, in order to make the trees present a light and dark effect, based on the three elements related to the light source, multiple branch insert models on the pine trees and maple trees can be determined as the sub-subjects to be distinguished and displayed. Thus, the color of the side of the pine tree illuminated by the light source is determined to be light green, and the color of the backlit area is determined to be dark green (i.e., dark information). The color of the side of the maple tree illuminated by the light source is determined to be light red, and the color of the backlit area is determined to be dark red (i.e., dark information).
[0084] S340. Display each sub-subject to be displayed based on the target attribute information, and replace the display information of the sub-subject to be distinguished with the dark information in the distinguishing display attribute information.
[0085] In this embodiment, after determining the main color information of the target subject and the dark color information of the sub-sub ...
[0086] After determining the target color information of the model corresponding to the sub-subject, to further optimize the display effect and improve the user experience, the target color information can be used as the color information to be processed. This target color information can be combined with grayscale information to adjust the color and obtain a new color. Grayscale information can be the grayscale value of one or more pixels corresponding to the target object, used to adjust the brightness and saturation of the color to be processed, typically ranging from 0 to 255. In essence, grayscale value is the "grayscale level" obtained by a pixel 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. For example, when multiple leaves on a branch have a color gradient from left to right, the leaves on the left are lighter and the leaves on the right are darker. Therefore, when the first vertex processes the tip of the branch, its grayscale value is the highest, and vice versa. After combining the leaf texture with the branch interpolation model, starting from the first vertex, the grayscale values of other points on the branch are determined according to their distance from the first vertex. The greater the distance, the lower the grayscale value. Then, the color information of each pixel in the branch and leaves is adjusted according to the grayscale value of the first vertex, so that the color of the branch is displayed from left to right in a light to dark effect. It should be noted that, similar to the target attribute information, grayscale information can also be stored in vertex color, UV attribute, or LUT texture for the models corresponding to each sub-body.
[0087] After determining the target color information of the model corresponding to the sub-sub ... For example, in a scene-based 3D coordinate system, with the bottom of the tree trunk as the zero point and the Z-axis representing the distance from the bottom to the top of the trunk, the height of the trunk is used as the baseline height (1 unit length). The color gradient step is set to 0.01. One hundred colors are selected sequentially from the green color gradation, and these colors are then mapped to the 100 heights of the tree trunk model from top to bottom according to the step size. When the heights of the three branches are 0.3, 0.6, and 0.9, it indicates that the three branches are located at Z-axis values of 0.3, 0.6, and 0.9, respectively. Therefore, based on the color information at different heights of the trunk and the height information of the three branches, it can be determined that the adjusted color of the branch with a Z-axis value of 0.3 is dark green, the adjusted color of the branch with a Z-axis value of 0.6 is standard green, and the adjusted color of the branch with a Z-axis value of 0.9 is light green. In other words, the color of the tree trunk can be used to determine the color of each branch, and the color of each branch should match the color of its location to create a more natural effect when displayed.
[0088] After determining the target color information of the model corresponding to the sub-subject, in order to further optimize the display effect and improve the user experience, the target color information can be used as the color information to be processed. This color information is then adjusted in conjunction with the occlusion information between the sub-subjects to obtain a new color. Occlusion information can describe the occlusion status of objects in the current scene. For example, if a tree needs to be loaded in the current scene, and the leaves of this tree are partially occluded, there are different occlusion situations for the occluded leaves. Some leaves may be occluded by multiple leaves, while others may be occluded by only one leaf. The information describing the occlusion status of the leaf texture in the current scene is the occlusion information. In this embodiment, to facilitate information processing, the occlusion information needs to be represented digitally. Therefore, the occlusion value needs to be determined based on the occlusion information between the sub-subjects. The occlusion value characterizes the occlusion status of the sub-subject in the current scene. The larger the occlusion value, the more severe the occlusion of the sub-subject, requiring a color much darker than the original color. Conversely, the smaller the occlusion value, the less severe the occlusion, requiring a color slightly darker than the original color. For example, in the current scene, leaves on a branch that are heavily occluded may appear black, while leaves that are only slightly or partially occluded may appear light green. It should be noted that, similar to target attribute information, occlusion information can also be stored in vertex colors, UV attributes, or LUT maps for the models corresponding to each sub-subject.
[0089] It should be noted that when optimizing the display effect of objects, the grayscale information, height information and occlusion information mentioned above can be used to further adjust the target color information corresponding to each sub-subject that constitutes the target subject. The above three types of information are described separately only to clearly introduce their respective adjustment methods. Those skilled in the art should understand that in actual applications, the above three adjustment methods can be performed simultaneously, and there is no strict limitation on the execution order.
[0090] The technical solution of this embodiment determines the sub-sub-subject to be distinguished and its corresponding dark color information based on the number of light sources, the intensity of the light sources, and / or the relative angle between the light sources and the target sub-sub-subject to be displayed, so that the object presents an effect of light and dark intersecting when displayed. Based on the determined target color information, the object color can be further adjusted using grayscale information, height information, and occlusion information to optimize the display effect of the object and further enhance the user experience.
[0091] Example 4
[0092] Figure 4 This is a structural block diagram of a device for determining display information provided in Embodiment 4 of the present invention. It can execute the method for determining display information provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method. For example... Figure 4As shown, the device specifically includes a retrieval module 410 and a display module 420.
[0093] The retrieval module 410 is used to retrieve target attribute information of each sub-sub ...
[0094] Display module 420 is used to display each sub-sub ...
[0095] Based on the above technical solutions, the device for determining the display information also includes a determining module and a storage module.
[0096] The determination module is used to determine the target subject to be displayed in each scene; determine the target attribute information of each sub-subject to be displayed in each target subject to be displayed and the distinguishing display attribute information of the sub-subject to be distinguished; wherein, the target attribute information includes subject color information.
[0097] A storage module is used to store the target attribute information and the distinguishing display attribute information to a target storage location, so that when a target subject is detected in the current scene, the target attribute information and the distinguishing display attribute information corresponding to the target subject can be retrieved from the target storage location; wherein, the target storage location includes vertex color, UV attribute or LUT texture.
[0098] Based on the above technical solutions, the determination module also includes a main body color information determination unit and a sub-main body to be distinguished display determination unit.
[0099] The main color information determination unit is used to determine the main color information of the target subject to be displayed.
[0100] The sub-sub ...
[0101] Optionally, the sub-sub-body to be distinguished display unit is further configured to determine the sub-sub-body to be distinguished display in the target subject to be displayed, and the dark color information of each sub-sub-body to be distinguished display, based on the number of light sources, the intensity of the light sources and / or the relative angle between the light sources and the target sub-sub-body to be displayed, and to use the dark color information as the distinguishing display attribute information.
[0102] Optionally, the retrieval module 410 is further configured to, when detecting that at least one target subject is included in the current scene, retrieve the target attribute information corresponding to each target subject and the distinguishing display attribute information of the sub-subject to be distinguished; wherein, the target attribute information includes the subject color information of the target subject.
[0103] Optionally, the display module 420 is also used to display each sub-subject to be displayed based on the target attribute information, and to replace the display information of the sub-subject to be distinguished with the dark information in the distinguishing display attribute information.
[0104] The technical solution provided in this embodiment, when detecting that the current scene includes a target subject, can retrieve the target attribute information of each sub-sub ...
[0105] The apparatus for determining display information provided in the embodiments of the present invention can execute the method for determining display information provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0106] 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.
[0107] Example 5
[0108] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. Figure 5 A block diagram is shown of an exemplary electronic device 50 suitable for implementing embodiments of the present invention. Figure 5 The electronic device 50 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.
[0109] like Figure 5 As shown, the electronic device 50 is represented in the form of a general-purpose computing device. The components of the electronic device 50 may include, but are not limited to: one or more processors or processing units 501, system memory 502, and bus 503 connecting different system components (including system memory 502 and processing unit 501).
[0110] Bus 503 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.
[0111] Electronic device 50 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 50, including volatile and non-volatile media, removable and non-removable media.
[0112] System memory 502 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 504 and / or cache memory 505. Electronic device 50 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 506 may be used to read and write non-removable, non-volatile magnetic media (… Figure 5 Not shown; usually referred to as a "hard drive"). Although Figure 5 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 503 via one or more data media interfaces. Memory 502 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.
[0113] A program / utility 508 having a set (at least one) of program modules 507 may be stored, for example, in memory 502. Such program modules 507 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 507 typically perform the functions and / or methods described in the embodiments of the present invention.
[0114] Electronic device 50 can also communicate with one or more external devices 509 (e.g., keyboard, pointing device, display 510, etc.), and with one or more devices that enable a user to interact with the electronic device 50, and / or with any device that enables the electronic device 50 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 511. Furthermore, electronic device 50 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 512. As shown, network adapter 512 communicates with other modules of electronic device 50 via bus 503. It should be understood that, although... Figure 5 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 50, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0115] The processing unit 501 executes various functional applications and data processing by running programs stored in the system memory 502, such as implementing the method for determining display information provided in the embodiments of the present invention.
[0116] Example 6
[0117] Embodiment 6 of the present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a method for determining display information.
[0118] The method includes:
[0119] When a target subject is detected in the current scene, the target attribute information of each sub-sub ...
[0120] Each sub-subject to be displayed is displayed based on the target attribute information, and the sub-subject to be distinguished is superimposed based on the distinguishing display attribute information.
[0121] 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.
[0122] 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.
[0123] 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.
[0124] 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).
[0125] 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 method for determining display information, characterized in that, include: Determine the target subject to be displayed in each scene, and the subject color information of the target subject to be displayed; wherein, the subject color information is the RGB value stored in the vertex color, UV attribute or LUT texture during the model creation process, which is used to characterize the color of the target subject to be displayed; Based on the number of light sources, light source intensity, and / or the relative angle between the light source and the subject to be displayed in the scene's light source information, the sub-sub ... When a target subject to be displayed is detected in the current scene, the target attribute information of each sub-sub ... Based on the target attribute information, each sub-subject to be displayed is displayed, and the target attribute information of the sub-subject to be distinguished is replaced with the target display information.
2. The method of claim 1, wherein, Before retrieving the target attribute information of each sub-sub ... The target attribute information of each sub-sub ... The target storage location includes vertex color, UV attributes, or LUT texture.
3. An apparatus for determining display information, characterized by include: The determination module determines the target subject to be displayed in each scene, as well as the subject color information of the target subject to be displayed; wherein, the subject color information is the RGB value stored in the vertex color, UV attribute or LUT texture during the model creation process, which is used to characterize the color of the target subject to be displayed; The determining module includes: a sub-sub-body to be distinguished display unit, used to determine the sub-sub-body to be distinguished display among the target bodies to be displayed, and the distinguishing display attribute information of each sub-sub-body to be distinguished display, based on the number of light sources, light source intensity and / or the relative angle between the light source and the sub-sub-body to be displayed contained in the light source information in the scene; and to superimpose the distinguishing display attribute information of the sub-sub-body to be distinguished display with the target attribute information of the sub-sub-body to be distinguished display, as the target display information of the sub-sub-body to be distinguished display; wherein, the target attribute information is the color information of the body color information at the sub-sub-body to be displayed; The retrieval module is used to retrieve the target attribute information of each sub-sub ... The display module is used to display each sub-subject to be displayed based on the target attribute information, and to replace the target attribute information of the sub-subject to be distinguished with the target display information.
4. The apparatus of claim 3, wherein, Also includes: The storage module is used to store the target attribute information and the distinguishing display attribute information of each sub-subject in each target subject to be displayed to a target storage location, so that when the target subject is detected in the current scene, the target attribute information and the distinguishing display attribute information corresponding to the target subject can be retrieved from the target storage location; wherein, the target storage location includes vertex color, UV attribute or LUT texture.
5. An electronic device, comprising: 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 method for determining display information as described in any one of claims 1-2.
6. A storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the method for determining display information as described in any one of claims 1-2.