CN113648653B - Game virtual object rendering method, device, equipment and storage medium - Google Patents

Game virtual object rendering method, device, equipment and storage medium Download PDF

Info

Publication number
CN113648653B
CN113648653B CN202110975278.0A CN202110975278A CN113648653B CN 113648653 B CN113648653 B CN 113648653B CN 202110975278 A CN202110975278 A CN 202110975278A CN 113648653 B CN113648653 B CN 113648653B
Authority
CN
China
Prior art keywords
color
virtual object
displayed corresponding
image area
displayed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110975278.0A
Other languages
Chinese (zh)
Other versions
CN113648653A (en
Inventor
郑继峰
夏丁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202110975278.0A priority Critical patent/CN113648653B/en
Publication of CN113648653A publication Critical patent/CN113648653A/en
Application granted granted Critical
Publication of CN113648653B publication Critical patent/CN113648653B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/02Non-photorealistic rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/30Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by output arrangements for receiving control signals generated by the game device
    • A63F2300/308Details of the user interface
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computer Graphics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application provides a virtual object rendering method, device and equipment for a game and a storage medium, and relates to the technical field of image processing. The method comprises the following steps: acquiring a plurality of virtual objects to be displayed; determining color difference values between the image areas to be displayed corresponding to the virtual objects according to the first rendering colors of the pixel points in the image areas to be displayed corresponding to the virtual objects; according to the color difference value between the image areas to be displayed corresponding to the virtual objects, adjusting the initial set color of each pixel point in the image area to be displayed corresponding to at least one target virtual object to obtain the target set color of each pixel point in the image area to be displayed corresponding to the target virtual object; and determining a second rendering color of the target virtual object according to the target setting color of each pixel point in the image area to be displayed corresponding to the target virtual object, and rendering and displaying the target virtual object by using the second rendering color. The method can realize dynamic adjustment of the color.

Description

Game virtual object rendering method, device, equipment and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method, an apparatus, a device, and a storage medium for rendering a virtual object of a game.
Background
For the current popular elimination games, most playing methods involve distinguishing colors, and different players can correspond to chessmen with different colors for elimination.
In general, different people have limited resolution in color, and it is difficult to ensure that players can accurately distinguish different kinds of pawns. Under the condition of more angular colors, the chessmen have similar colors, and the scene rendering effect and the background effect are also present in the game, so that the difficulty of color distinction can be further increased.
At present, how to adjust the difference degree between different colors to ensure accurate color distinction of players is a problem to be solved.
Disclosure of Invention
The application aims to provide a method, a device, equipment and a storage medium for rendering a virtual object of a game aiming at the defects in the prior art, so as to solve the problem that the colors of virtual props in the game are difficult to distinguish in the prior art.
In order to achieve the above purpose, the technical scheme adopted by the embodiment of the application is as follows:
in a first aspect, an embodiment of the present application provides a method for rendering a virtual object of a game, where a graphical user interface is provided by a terminal device, where a plurality of virtual objects are displayed in the graphical user interface, the method includes:
Acquiring a plurality of virtual objects to be displayed;
Determining color difference values between the image areas to be displayed corresponding to the virtual objects according to the first rendering colors of the pixel points in the image areas to be displayed corresponding to the virtual objects;
According to color difference values among image areas to be displayed corresponding to the virtual objects, adjusting initial set colors of pixel points in the image areas to be displayed corresponding to at least one target virtual object to obtain target set colors of the pixel points in the image areas to be displayed corresponding to the target virtual object, wherein the target virtual object is a virtual object to be displayed which does not meet color difference conditions, and the first rendering color of the pixel points is obtained based on the initial set colors of the pixel points;
And determining a second rendering color of the target virtual object according to the target setting color of each pixel point in the image area to be displayed corresponding to the target virtual object, and rendering and displaying the target virtual object by using the second rendering color.
Optionally, the adjusting the initial setting color of each pixel point in the image area to be displayed corresponding to the at least one target virtual object according to the color difference value between the image areas to be displayed corresponding to each virtual object includes:
If the color difference value between the image area to be displayed corresponding to the first virtual object and the image area to be displayed corresponding to at least one second virtual object is smaller than a preset threshold value, determining the first virtual object and the second virtual object as target virtual objects, further adjusting the mapping points of the image area to be displayed corresponding to the first virtual object in a color space, and adjusting the mapping points of the image area to be displayed corresponding to each second virtual object in the color space, wherein the first virtual object is any one of the virtual objects, and the second virtual object is other virtual objects except the first virtual object;
According to the adjusted mapping points, determining new colors of the image areas to be displayed corresponding to the first virtual objects and new colors of the image areas to be displayed corresponding to the second virtual objects respectively;
And respectively adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to the second virtual object.
Optionally, the adjusting the mapping point of the image area to be displayed corresponding to the first virtual object in the color space includes:
respectively determining the connection direction of the mapping points of the image areas to be displayed corresponding to the second virtual objects in the color space to the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space;
according to the connecting line direction, determining an adjustment direction of a mapping point of the image area to be displayed, corresponding to the first virtual object, in a color space;
And according to the adjustment direction, adjusting the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space so that the color difference value between the image areas to be displayed corresponding to the first virtual objects and the image areas to be displayed corresponding to the second virtual objects is larger than or equal to a preset threshold value.
Optionally, the adjusting the initial setting color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial setting color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to the second virtual object includes:
Determining a new set color of each pixel point in the image area to be displayed corresponding to the first virtual object and a new set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to the second virtual object;
And respectively adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the new set color of each pixel point in the image area to be displayed corresponding to the second virtual object.
Optionally, the determining, according to the adjusted mapping point, a new color of the image area to be displayed corresponding to the first virtual object and a new color of the image area to be displayed corresponding to each second virtual object respectively includes:
determining the color of a mapping point of the image area to be displayed, which corresponds to the first virtual object, after being adjusted in a color space;
Taking the color of the mapping point of the image area to be displayed, corresponding to the first virtual object, after being adjusted in the color space as the new color of the image area to be displayed, corresponding to the first virtual object;
determining the color of the mapping point of the image area to be displayed, which corresponds to each second virtual object, after being adjusted in the color space;
and taking the colors of the mapping points of the image areas to be displayed corresponding to the second virtual objects after the adjustment in the color space as the new colors of the image areas to be displayed corresponding to the second virtual objects.
Optionally, after the adjusting the mapping points of the image area to be displayed corresponding to the first virtual object in the color space and the adjusting the mapping points of the image area to be displayed corresponding to each second virtual object in the color space, the method further includes:
If the color of the image area to be displayed corresponding to the first virtual object is determined to be the same as the color before the adjustment of the mapping point according to the adjusted mapping point, the initial setting color of each pixel point in the image area to be displayed corresponding to the first virtual object is not adjusted;
If the color of the image area to be displayed corresponding to the second virtual object is determined to be the same as the color before the adjustment of the mapping point according to the adjusted mapping point, the initial setting color of each pixel point in the image area to be displayed corresponding to the second virtual object is not adjusted.
Optionally, the determining, according to the first rendering color of each pixel point in the image area to be displayed corresponding to each virtual object, a color difference value between the image areas to be displayed corresponding to each virtual object includes:
and calculating an average value of the first rendering colors of the pixel points in the first image area to be displayed, and taking the average value as the color of the first image area to be displayed, wherein the first image area to be displayed is the image area to be displayed corresponding to any virtual object.
Optionally, the determining, according to the first rendering color of each pixel point in the image area to be displayed corresponding to each virtual object, a color difference value between the image areas to be displayed corresponding to each virtual object includes:
According to the colors of the image areas to be displayed corresponding to the virtual objects, mapping the image areas to be displayed corresponding to the virtual objects into a color space respectively, and determining mapping points of the image areas to be displayed corresponding to the virtual objects in the color space, wherein the color space is an RGB color space;
And determining color difference values among the image areas to be displayed corresponding to the virtual objects according to the colors of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space.
Optionally, the mapping the image area to be displayed corresponding to each virtual object to a color space according to the color of the image area to be displayed corresponding to each virtual object, and determining the mapping point of the image area to be displayed corresponding to each virtual object in the color space includes:
according to the colors of the image areas to be displayed corresponding to the virtual objects, determining three-dimensional coordinate information of mapping points of the image areas to be displayed, which are mapped to a color space;
And determining the mapping points of the image area to be displayed in the color space according to the three-dimensional coordinate information.
Optionally, the determining a color difference value between the image areas to be displayed corresponding to the virtual objects according to the colors of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space includes:
and determining color difference values among the image areas to be displayed corresponding to the virtual objects by adopting an Euclidean distance calculation formula according to the color values of the red, green and blue three channels of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space.
Optionally, the method further comprises:
If the color of the image area to be displayed corresponding to the first virtual object is the same as the color of the image area to be displayed corresponding to the second virtual object, and the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object is different from the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object;
Determining the color of the image area to be displayed according to the first rendering color of each pixel point in the image area to be displayed corresponding to at least one first virtual object with the same initial setting color;
And taking the color of the image area to be displayed as the color of the image area to be displayed corresponding to each first virtual object.
Optionally, the adjusting the mapping point of the image area to be displayed corresponding to the first virtual object in the color space includes:
respectively determining the connection direction of the mapping points of the image areas to be displayed corresponding to the second virtual objects in the color space to the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space;
according to the connecting line direction, determining an adjustment direction of a mapping point of the image area to be displayed, corresponding to the first virtual object, in a color space;
And adjusting the mapping point of the image area to be displayed corresponding to the first virtual object in a color space according to the adjustment direction and the direction corresponding to the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object.
In a second aspect, an embodiment of the present application further provides a virtual object rendering apparatus for a game, where a graphical user interface is provided through a terminal device, where a plurality of virtual objects are displayed in the graphical user interface, and the apparatus includes: the device comprises an acquisition module, a determination module and a rendering module;
the acquisition module is used for acquiring a plurality of virtual objects to be displayed;
The determining module is used for determining color difference values between the image areas to be displayed corresponding to the virtual objects according to the first rendering colors of the pixel points in the image areas to be displayed corresponding to the virtual objects;
the obtaining module is configured to adjust an initial set color of each pixel point in the image area to be displayed corresponding to at least one target virtual object according to a color difference value between the image areas to be displayed corresponding to each virtual object, so as to obtain a target set color of each pixel point in the image area to be displayed corresponding to the target virtual object, where the target virtual object is a virtual object to be displayed that does not meet a color difference condition, and a first rendering color of the pixel point is obtained based on the initial set color of the pixel point;
the rendering module is configured to determine a second rendering color of the target virtual object according to a target setting color of each pixel point in the image area to be displayed corresponding to the target virtual object, and render and display the target virtual object by using the second rendering color.
Optionally, the acquiring module is specifically configured to
If the color difference value between the image area to be displayed corresponding to the first virtual object and the image area to be displayed corresponding to at least one second virtual object is smaller than a preset threshold value, determining the first virtual object and the second virtual object as target virtual objects, further adjusting the mapping points of the image area to be displayed corresponding to the first virtual object in a color space, and adjusting the mapping points of the image area to be displayed corresponding to each second virtual object in the color space, wherein the first virtual object is any one of the virtual objects, and the second virtual object is other virtual objects except the first virtual object;
According to the adjusted mapping points, determining new colors of the image areas to be displayed corresponding to the first virtual objects and new colors of the image areas to be displayed corresponding to the second virtual objects respectively;
And respectively adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to the second virtual object.
Optionally, the acquiring module is specifically configured to
Respectively determining the connection direction of the mapping points of the image areas to be displayed corresponding to the second virtual objects in the color space to the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space;
according to the connecting line direction, determining an adjustment direction of a mapping point of the image area to be displayed, corresponding to the first virtual object, in a color space;
And according to the adjustment direction, adjusting the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space so that the color difference value between the image areas to be displayed corresponding to the first virtual objects and the image areas to be displayed corresponding to the second virtual objects is larger than or equal to a preset threshold value.
Optionally, the acquiring module is specifically configured to
Determining a new set color of each pixel point in the image area to be displayed corresponding to the first virtual object and a new set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to the second virtual object;
And respectively adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the new set color of each pixel point in the image area to be displayed corresponding to the second virtual object.
Optionally, the acquiring module is specifically configured to
Determining the color of a mapping point of the image area to be displayed, which corresponds to the first virtual object, after being adjusted in a color space;
Taking the color of the mapping point of the image area to be displayed, corresponding to the first virtual object, after being adjusted in the color space as the new color of the image area to be displayed, corresponding to the first virtual object;
determining the color of the mapping point of the image area to be displayed, which corresponds to each second virtual object, after being adjusted in the color space;
and taking the colors of the mapping points of the image areas to be displayed corresponding to the second virtual objects after the adjustment in the color space as the new colors of the image areas to be displayed corresponding to the second virtual objects.
Optionally, the apparatus further comprises: an adjustment module;
the adjustment module is configured to, if it is determined, according to the adjusted mapping point, that the color of the image area to be displayed corresponding to the first virtual object is the same as the color before adjustment of the mapping point, not adjust the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object;
If the color of the image area to be displayed corresponding to the second virtual object is determined to be the same as the color before the adjustment of the mapping point according to the adjusted mapping point, the initial setting color of each pixel point in the image area to be displayed corresponding to the second virtual object is not adjusted.
Optionally, the determining module is specifically configured to
And calculating an average value of the first rendering colors of the pixel points in the first image area to be displayed, and taking the average value as the color of the first image area to be displayed, wherein the first image area to be displayed is the image area to be displayed corresponding to any virtual object.
Optionally, the determining module is specifically configured to
According to the colors of the image areas to be displayed corresponding to the virtual objects, mapping the image areas to be displayed corresponding to the virtual objects into a color space respectively, and determining mapping points of the image areas to be displayed corresponding to the virtual objects in the color space, wherein the color space is an RGB color space;
And determining color difference values among the image areas to be displayed corresponding to the virtual objects according to the colors of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space.
Optionally, the determining module is specifically configured to
According to the colors of the image areas to be displayed corresponding to the virtual objects, determining three-dimensional coordinate information of mapping points of the image areas to be displayed, which are mapped to a color space;
And determining the mapping points of the image area to be displayed in the color space according to the three-dimensional coordinate information.
Optionally, the determining module is specifically configured to
And determining color difference values among the image areas to be displayed corresponding to the virtual objects by adopting an Euclidean distance calculation formula according to the color values of the red, green and blue three channels of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space.
Optionally, the determining module is further configured to
If the color of the image area to be displayed corresponding to the first virtual object is the same as the color of the image area to be displayed corresponding to the second virtual object, and the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object is different from the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object;
Determining the color of the image area to be displayed according to the first rendering color of each pixel point in the image area to be displayed corresponding to at least one first virtual object with the same initial setting color;
And taking the color of the image area to be displayed as the color of the image area to be displayed corresponding to each first virtual object.
Optionally, the acquiring module is further configured to
Respectively determining the connection direction of the mapping points of the image areas to be displayed corresponding to the second virtual objects in the color space to the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space;
according to the connecting line direction, determining an adjustment direction of a mapping point of the image area to be displayed, corresponding to the first virtual object, in a color space;
And adjusting the mapping point of the image area to be displayed corresponding to the first virtual object in a color space according to the adjustment direction and the direction corresponding to the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor, a storage medium, and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over the bus when the electronic device is operating, the processor executing the machine-readable instructions to perform the steps of the method as provided in the first aspect when executed.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method as provided in the first aspect.
The beneficial effects of the application are as follows:
The application provides a virtual object rendering method, a device, equipment and a storage medium for a game, wherein the method can comprise the following steps: acquiring a plurality of virtual objects to be displayed; determining color difference values between the image areas to be displayed corresponding to the virtual objects according to the first rendering colors of the pixel points in the image areas to be displayed corresponding to the virtual objects; according to the color difference value between the image areas to be displayed corresponding to the virtual objects, adjusting the initial set color of each pixel point in the image area to be displayed corresponding to at least one target virtual object to obtain the target set color of each pixel point in the image area to be displayed corresponding to the target virtual object; and determining a second rendering color of the target virtual object according to the target setting color of each pixel point in the image area to be displayed corresponding to the target virtual object, and rendering and displaying the target virtual object by using the second rendering color. According to the method, based on the colors of the image areas to be displayed corresponding to the virtual objects, the color difference values among the image areas to be displayed corresponding to the virtual objects can be determined, when the color difference values do not meet the color difference conditions, the set colors of the pixel points in the image areas to be displayed corresponding to the virtual objects are adjusted to adjust the first rendering colors of the pixel points in the image areas to be displayed corresponding to the virtual objects, so that the virtual objects are generated based on the adjusted second rendering colors, dynamic adjustment of the rendering colors of the virtual objects can be achieved, the color difference degree among the virtual objects is effectively increased, color resolution of a game player on the virtual objects is clearer, and game experience of the player is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart illustrating a virtual object rendering method of a game according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a graphical user interface according to an embodiment of the present application;
FIG. 3 is a second flow chart of a virtual object rendering method of a game according to an embodiment of the present application;
Fig. 4 is a flowchart illustrating a virtual object rendering method of a game according to an embodiment of the present application;
FIG. 5 is a schematic diagram of mapping points in a color space according to an embodiment of the present application;
FIG. 6 is a flowchart illustrating a virtual object rendering method of a game according to an embodiment of the present application;
fig. 7 is a flowchart of a virtual object rendering method of a game according to an embodiment of the present application;
FIG. 8 is a flowchart illustrating a virtual object rendering method of a game according to an embodiment of the present application;
FIG. 9 is a flowchart of a virtual object rendering method of a game according to an embodiment of the present application;
FIG. 10 is a flowchart illustrating a virtual object rendering method of a game according to an embodiment of the present application;
FIG. 11 is a flowchart illustrating a virtual object rendering method of a game according to an embodiment of the present application;
FIG. 12 is a schematic diagram of a virtual object rendering apparatus for a game according to an embodiment of the present application;
Fig. 13 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for the purpose of illustration and description only and are not intended to limit the scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. A flowchart, as used in this disclosure, illustrates operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be implemented out of order and that steps without logical context may be performed in reverse order or concurrently. Moreover, one or more other operations may be added to or removed from the flow diagrams by those skilled in the art under the direction of the present disclosure.
In addition, the described embodiments are only some, but not all, embodiments of the application. The components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the application, as presented in the figures, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by a person skilled in the art without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that the term "comprising" will be used in embodiments of the application to indicate the presence of the features stated hereafter, but not to exclude the addition of other features.
Fig. 1 is a flowchart illustrating a virtual object rendering method of a game according to an embodiment of the present application; FIG. 2 is a schematic diagram of a graphical user interface according to an embodiment of the present application; the execution subject of the method can be a terminal device or a server, and when the execution subject is the terminal device, the terminal device can locally execute the method for determining the second rendering color of the target virtual object and rendering and displaying a plurality of virtual objects on the terminal device according to the second rendering color. And in the case of a server, the method may be performed on the server to determine a second rendering color of the target virtual object and send the second rendering color to the terminal device, so that the terminal device renders and displays the plurality of virtual objects according to the second rendering color. As shown in fig. 1, the method may include:
S101, acquiring a plurality of virtual objects to be displayed.
The plurality of virtual objects to be displayed may be virtual objects to be displayed in the set game screen in the game development process. Acquiring relevant information of a plurality of virtual objects to be displayed, for example: rendering colors of virtual objects to be displayed, and the like.
S102, determining color difference values between the image areas to be displayed corresponding to the virtual objects according to the first rendering colors of the pixel points in the image areas to be displayed corresponding to the virtual objects.
It should be noted that, the method of the present application may be applied to elimination games, where virtual objects with different colors represent objects to be eliminated by different players, when there are more game players, more virtual objects with different colors are presented in the gui, and because the number of colors in the color space is limited and many colors are similar, it is difficult for the game players to distinguish between virtual objects with different colors, resulting in erroneous elimination, affecting the game experience, etc.
The virtual object in this embodiment may be referred to as a game piece, and the game player wins the win by eliminating the corresponding color piece. Alternatively, a plurality of virtual objects may be displayed on the graphical user interface of the terminal device, and the plurality of virtual objects may be presented in different colors, wherein the presented colors are colors after the full art effect and the post-processing effect are superimposed. As shown in fig. 2, it is assumed in fig. 2 (a) that 9 virtual objects are displayed on the graphical user interface, which appear red, green, blue, and gray, respectively. Different virtual objects occupy a region of the gui, optionally, the image region to be displayed corresponding to each virtual object may be defined, so as to obtain a division result as shown in fig. 2 (b), and virtual objects with the same color may be represented by the same image region number to be displayed, for example: the numbers of the image areas to be displayed corresponding to the green virtual objects are all indicated as an area 1. It should be noted that, since the virtual objects in the present embodiment are represented by rectangles, after the corresponding image areas to be displayed of the virtual objects are divided, the boundary of the image area to be displayed corresponding to each virtual object overlaps with the boundary of the virtual object itself, that is, the shape of the virtual object itself overlaps with the shape of the image area to be displayed corresponding to the virtual object, so that the shape of the image area to be displayed is not purposely displayed in the figure.
Optionally, the color of the image area to be displayed corresponding to each virtual object may be determined based on the first rendering color of each pixel point included in the image area to be displayed corresponding to each virtual object, where the first rendering color of each pixel point is the color that is actually presented in the graphical user interface finally. And the color referred to herein may refer to the color value of the red, green and blue three channels of the pixel. The color of the image area to be displayed corresponding to each virtual object can be represented by the average color of the first rendering color of each pixel point in the area. As shown in fig. 2 (c), the colors of the image areas to be displayed corresponding to the virtual objects of the same color are theoretically the same, and are represented by the same color identification, for example: the colors of the image areas to be displayed corresponding to the green virtual objects are all color 1.
In some embodiments, based on the colors of the image areas to be displayed corresponding to the virtual objects, color difference values between the image areas to be displayed corresponding to any two virtual objects may be calculated in pairs, where the color difference values of the image areas to be displayed may be represented by the size of the spatial distance between the colors of the image areas to be displayed corresponding to any two virtual objects. It should be noted that the larger the spatial distance is, the larger the color difference value is.
S103, according to color difference values among the image areas to be displayed corresponding to the virtual objects, initial setting colors of the pixel points in the image areas to be displayed corresponding to at least one target virtual object are adjusted to obtain target setting colors of the pixel points in the image areas to be displayed corresponding to the target virtual object, wherein the target virtual object is the virtual object to be displayed which does not meet the color difference conditions, and the first rendering color of the pixel points is obtained based on the initial setting colors of the pixel points.
In some embodiments, according to the obtained color difference value between the image areas to be displayed corresponding to the virtual objects, the color of at least one target virtual object whose color difference value does not meet the color difference condition may be adjusted, and optionally, the color of the target virtual object is adjusted, that is, the color of each pixel point in the image area to be displayed corresponding to the target virtual object is adjusted. Optionally, a preset threshold is set for the color difference, and if the color difference value between the image areas to be displayed corresponding to each virtual object is smaller than the preset threshold, the virtual object is determined to be a target virtual object which does not meet the color difference condition. The preset threshold value can be obtained through intelligent analysis according to sensory experience data of the user on the color through an artificial intelligence technology.
Alternatively, each virtual object typically corresponds to a set color before being rendered, and the rendering color of the virtual object may be calculated by a series of functions f based on the set color, including but not limited to superposition, color filtering, addition with other colors, multiplication, light shadow calculation, and the like, where the superposition is obtained on a 2D or 3D material in the image area to be displayed corresponding to the virtual object, and may be understood as { rendering color } = f (set color). The rendering color or the setting color may refer to a first rendering color of each pixel point or a setting color of each pixel point in the image area to be displayed corresponding to the virtual object, that is, the color of the virtual object is formed by the colors of each pixel point forming the virtual object.
In this embodiment, when the color difference value does not meet the color difference condition, the initial set color of each pixel point in the image area to be displayed corresponding to the target virtual object may be adjusted to obtain the target set color.
S104, determining a second rendering color of the target virtual object according to the target setting color of each pixel point in the image area to be displayed corresponding to the target virtual object, and rendering and displaying the target virtual object by using the second rendering color.
Optionally, based on the target set color of each pixel point in the image area to be displayed corresponding to the target virtual object, the inverse function may be obtained based on the above-mentioned relational expression of the rendering color and the set color, and the second rendering color of the target virtual object may be calculated, that is, the second rendering color of each pixel point in the image area to be displayed corresponding to the target virtual object is determined, so that the second rendering color and the rendering function may be used for rendering to obtain the target virtual object and display the target virtual object in the graphical user interface, so that the rendering color of the target virtual object may be adjusted, so that the color presented by the target virtual object may be greatly different from the color presented by other virtual objects, and the color difference between the virtual objects may be increased.
It should be noted that, the second rendering color and the "first" and "second" in the first rendering color are not in any practical sense, and are only used to distinguish the rendering colors of different virtual objects.
To sum up, the virtual object rendering method of the game provided in this embodiment includes: acquiring a plurality of virtual objects to be displayed; determining color difference values between the image areas to be displayed corresponding to the virtual objects according to the first rendering colors of the pixel points in the image areas to be displayed corresponding to the virtual objects; according to the color difference value between the image areas to be displayed corresponding to the virtual objects, adjusting the initial set color of each pixel point in the image area to be displayed corresponding to at least one target virtual object to obtain the target set color of each pixel point in the image area to be displayed corresponding to the target virtual object; and determining a second rendering color of the target virtual object according to the target setting color of each pixel point in the image area to be displayed corresponding to the target virtual object, and rendering and displaying the target virtual object by using the second rendering color. According to the method, based on the colors of the image areas to be displayed corresponding to the virtual objects, the color difference values among the image areas to be displayed corresponding to the virtual objects can be determined, when the color difference values do not meet the color difference conditions, the set colors of the pixel points in the image areas to be displayed corresponding to the virtual objects are adjusted to adjust the first rendering colors of the pixel points in the image areas to be displayed corresponding to the virtual objects, so that the virtual objects are generated based on the adjusted second rendering colors, dynamic adjustment of the rendering colors of the virtual objects can be achieved, the color difference degree among the virtual objects is effectively increased, color resolution of a game player on the virtual objects is clearer, and game experience of the player is improved.
FIG. 3 is a second flow chart of a virtual object rendering method of a game according to an embodiment of the present application; optionally, in step S103, adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the at least one target virtual object according to the color difference value between the image areas to be displayed corresponding to each virtual object may include:
S301, if a color difference value between an image area to be displayed corresponding to a first virtual object and an image area to be displayed corresponding to at least one second virtual object is smaller than a preset threshold, determining the first virtual object and the second virtual object as target virtual objects, further adjusting mapping points of the image area to be displayed corresponding to the first virtual object in a color space, and adjusting mapping points of the image area to be displayed corresponding to each second virtual object in the color space, wherein the first virtual object is any one of the virtual objects, and the second virtual object is other virtual objects except the first virtual object.
Because the virtual objects include a plurality of virtual objects, color difference values between the to-be-displayed image areas corresponding to any two virtual objects may not meet the color difference condition, in one implementation manner, whether the color difference values between the to-be-displayed image areas corresponding to the first virtual object and the to-be-displayed image areas corresponding to at least one second virtual object are smaller than a preset threshold value may be calculated respectively, where the first virtual object is any one of the plurality of virtual objects, and the second virtual object is other virtual objects except the first virtual object. That is, for any one virtual object, the color difference value between the image area to be displayed corresponding to the virtual object and the image areas to be displayed corresponding to all other virtual objects is calculated respectively.
Optionally, if the color difference value is smaller than the preset threshold, the mapping points of the image area to be displayed corresponding to the first virtual object in the color space may be adjusted, and simultaneously the mapping points of the image area to be displayed corresponding to each second virtual object in the color space may be adjusted. Assuming that the first virtual object is the virtual object 1, at least one virtual object is the virtual object 2, the virtual object 3 and the virtual object 4 respectively, assuming that a color difference value between an image area to be displayed corresponding to the virtual object 1 and an image area to be displayed corresponding to the virtual object 2 is smaller than a preset threshold, a color difference value between an image area to be displayed corresponding to the virtual object 1 and an image area to be displayed corresponding to the virtual object 3 is greater than or equal to the preset threshold, and a color difference value between an image area to be displayed corresponding to the virtual object 1 and an image area to be displayed corresponding to the virtual object 4 is smaller than the preset threshold, then the mapping points of the image area to be displayed corresponding to the virtual object 1 in the color space, the mapping points of the image area to be displayed corresponding to the virtual object 2 in the color space, and the mapping points of the image area to be displayed corresponding to the virtual object 4 in the color space can be adjusted respectively. Since the color difference value between the virtual object 1 and the virtual object 3 satisfies the color difference condition, the mapping point of the image area to be displayed corresponding to the virtual object 3 in the color space does not need to be adjusted.
S302, according to the adjusted mapping points, determining new colors of the image areas to be displayed corresponding to the first virtual objects and new colors of the image areas to be displayed corresponding to the second virtual objects respectively.
Optionally, based on each adjusted mapping point, a new color of the image area to be displayed corresponding to the first virtual object and a new color of the image area to be displayed corresponding to each second virtual object may be reversely deduced. The color of the image area to be displayed corresponding to the virtual object and the mapping point of the image area to be displayed corresponding to the virtual object in the color space have a certain mapping relation, and the mapping point of the image area to be displayed corresponding to the virtual object in the color space can be determined forward according to the color of the image area to be displayed corresponding to the virtual object. Similarly, the color of the image area to be displayed corresponding to the virtual object can be calculated reversely according to the mapping point of the image area to be displayed corresponding to the virtual object in the color space.
The mapping points are adjusted, so that the color of the image area to be displayed corresponding to the virtual object is changed, and a new color of the image area to be displayed is obtained.
S303, according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to each second virtual object, respectively adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial set color of each pixel point in the image area to be displayed corresponding to each second virtual object.
Optionally, the color of the image area to be displayed corresponding to the virtual object is calculated according to the rendering first color of each pixel point in the image area to be displayed corresponding to the virtual object, and the rendering color of the first pixel point in the image area to be displayed corresponding to the virtual object is calculated according to the initial setting color of each pixel point in the image area to be displayed corresponding to the virtual object, that is, a certain mapping relationship exists between the color of the image area to be displayed corresponding to the virtual object and the first rendering color of each pixel point in the image area to be displayed corresponding to the virtual object, and the initial setting color of each pixel point in the image area to be displayed corresponding to the virtual object.
Fig. 4 is a flowchart illustrating a virtual object rendering method of a game according to an embodiment of the present application; fig. 5 is a schematic diagram of mapping points in a color space according to an embodiment of the present application. Optionally, in step S301, adjusting the mapping point of the image area to be displayed corresponding to the first virtual object in the color space may include:
S401, determining that mapping points of the image areas to be displayed corresponding to the second virtual objects in the color space point to the connecting line directions of the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space respectively.
As will be understood in conjunction with fig. 5, it is assumed that the mapping points of the image area to be displayed corresponding to the first virtual object in the color space are P1, and the mapping points of the image area to be displayed corresponding to each second virtual object in the color space are P2, P3, and P4, respectively. Assuming that color difference values between the image areas to be displayed corresponding to the first virtual objects and the image areas to be displayed corresponding to the second virtual objects are smaller than a preset threshold, that is, color difference values between P1-P2, P1-P3 and P1-P4 are smaller than the preset threshold, connection lines can be respectively made along P2-P1, P3-P1 and P4-P1, and it is determined that the connection line direction of P2 pointing to P1 is a direction 1, the connection line direction of P3 pointing to P1 is a direction 2, and the connection line direction of P4 pointing to P1 is a direction 3.
S402, determining an adjustment direction of a mapping point of the image area to be displayed, corresponding to the first virtual object, in a color space according to the connection direction.
Alternatively, based on direction 1, direction 2, and direction 3, the resultant force direction between direction 1 and direction 2, and direction 3, may be determined, where the determination may be made using a formula in physics that calculates the resultant force direction. The resultant force direction is assumed to be direction 4, that is, the adjustment direction of the mapping point of the image area to be displayed corresponding to the first virtual object in the color space is assumed to be direction 4.
And S403, according to the adjustment direction, adjusting the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space so that the color difference value between the image areas to be displayed corresponding to the first virtual objects and the image areas to be displayed corresponding to the second virtual objects is larger than or equal to a preset threshold value.
Optionally, for the first virtual object, the mapping point P1 of the image area to be displayed corresponding to the first virtual object in the color space may be adjusted along the above-determined adjustment direction 4.
It should be noted that, if the first virtual object may be any one of the virtual objects, then, in fig. 5, when the mapping point of the image area to be displayed corresponding to the first virtual object in the color space is P1, the mapping points of the image area to be displayed corresponding to the second virtual object in the color space are P2, P3, and P4, and when the mapping point of the image area to be displayed corresponding to the first virtual object in the color space is P2, the mapping points of the image area to be displayed corresponding to the second virtual object in the color space are P1, P3, and P4, respectively, so that, based on the above determination manner of the adjustment direction of the mapping point of the image area to be displayed corresponding to the first virtual object in the color space, the adjustment direction of the mapping point of the image area to be displayed corresponding to the virtual object in the color space can be determined respectively.
In one implementation manner, based on the adjustment direction of the mapping points of the image areas to be displayed corresponding to each virtual object in the color space, the mapping points of the image areas to be displayed corresponding to each virtual object in the color space can be moved according to the respective corresponding adjustment directions, and when the color difference value between the image areas to be displayed corresponding to each virtual object is made to be greater than or equal to a preset threshold value, adjustment is stopped, so that the adjusted mapping points of each virtual object are respectively obtained.
FIG. 6 is a flowchart illustrating a virtual object rendering method of a game according to an embodiment of the present application; optionally, in step S303, adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to the second virtual object, respectively may include:
S601, determining a new set color of each pixel point in the image area to be displayed corresponding to the first virtual object and a new set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to the second virtual object.
As mentioned in the foregoing embodiment, the color of the image area to be displayed corresponding to the virtual object has a certain mapping relationship with the first rendering color of each pixel point in the image area to be displayed corresponding to the virtual object and the initial setting color of each pixel point in the image area to be displayed corresponding to the virtual object, based on the new color of the image area to be displayed corresponding to the first virtual object, the new rendering color of each pixel point in the image area to be displayed corresponding to the first virtual object may be calculated first, and based on the new rendering color of each pixel point in the image area to be displayed corresponding to the first virtual object, the new setting color of each pixel point in the image area to be displayed corresponding to the first virtual object may be calculated by adopting a functional relation between the rendering color and the setting color.
S602, adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the new set color of each pixel point in the image area to be displayed corresponding to the second virtual object.
Optionally, the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object may be changed to the calculated new set color of each pixel point in the image area to be displayed corresponding to the first virtual object, so that based on the new set color of each pixel point in the image area to be displayed corresponding to the first virtual object, a new color of each pixel point in the image area to be displayed corresponding to the first virtual object may be calculated, and the new color of each pixel point may be used to render to obtain a new first virtual object, so that the color of the first virtual object rendered in the picture is adjusted, and the color difference degree with other virtual objects is increased.
Similarly, the same processing method as described above may be used to adjust the initial setting color of each pixel point in the image area to be displayed corresponding to each second virtual object, which is not described herein again.
Fig. 7 is a flowchart of a game virtual object rendering method according to an embodiment of the present application; optionally, in step S302, determining, according to the adjusted mapping points, a new color of the image area to be displayed corresponding to the first virtual object and a new color of the image area to be displayed corresponding to each second virtual object respectively may include:
S701, determining the color of the mapping point of the image area to be displayed, which corresponds to the first virtual object, after being adjusted in the color space.
The color space in this embodiment refers to an RGB color space, where the color of each point in the space refers to the color value of the red, green and blue three channels of the point, and based on the mapping point of the image area to be displayed corresponding to the first virtual object after adjustment in the color space, the color of the mapping point of the image area to be displayed corresponding to the first virtual object after adjustment in the color space can be obtained.
S702, taking the color of the mapping point of the image area to be displayed corresponding to the first virtual object after being adjusted in the color space as the new color of the image area to be displayed corresponding to the first virtual object.
Optionally, the determined color of the mapping point of the image area to be displayed corresponding to the first virtual object after adjustment in the color space may be used as a new color of the image area to be displayed corresponding to the first virtual object.
S703, determining the color of the mapping point of the image area to be displayed corresponding to each second virtual object after adjustment in the color space.
S704, the colors of the mapping points of the image areas to be displayed corresponding to the second virtual objects after being adjusted in the color space are respectively used as new colors of the image areas to be displayed corresponding to the second virtual objects.
Similarly, for each second virtual object, a new color of the image area to be displayed corresponding to each second virtual object is determined by the same method as described above.
Optionally, in step S301, after adjusting the mapping points of the image area to be displayed corresponding to the first virtual object in the color space and adjusting the mapping points of the image area to be displayed corresponding to each second virtual object in the color space, the method of the present application may further include:
If the color of the image area to be displayed corresponding to the first virtual object is determined to be the same as the color before the adjustment of the mapping point according to the adjusted mapping point, the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object is not adjusted.
If the color of the image area to be displayed corresponding to the second virtual object is determined to be the same as the color before the adjustment of the mapping point according to the adjusted mapping point, the initial setting color of each pixel point in the image area to be displayed corresponding to the second virtual object is not adjusted.
It should be noted that, in some cases, after the mapping points of the image area to be displayed corresponding to the first virtual object in the color space are adjusted, it is determined that the color of the image area to be displayed corresponding to the first virtual object calculated according to the adjusted mapping points is the same as the color before the mapping points are not adjusted, that is, the color of the image area to be displayed corresponding to the first virtual object calculated according to the adjusted mapping points is the same as the initial color of the image area to be displayed corresponding to the first virtual object, then the rendering color of each pixel point in the image area to be displayed corresponding to the first virtual object is kept unchanged, that is, the initial setting color of each pixel point in the image area to be displayed corresponding to the first virtual object is not adjusted. The second virtual objects are the same, and if the conditions are met, the second virtual objects are not adjusted.
Optionally, in step S102, determining a color difference value between the to-be-displayed image areas corresponding to the virtual objects according to the first rendering color of each pixel point in the to-be-displayed image area corresponding to each virtual object may include: and calculating an average value of the first rendering colors of the pixel points in the first image area to be displayed, wherein the average value is used as the color of the first image area to be displayed, and the first image area to be displayed is the image area to be displayed corresponding to any virtual object.
In one implementation manner, for the calculation of the color of the image area to be displayed corresponding to any virtual object, an average value of the first rendering colors of the pixel points in the image area to be displayed may be calculated, and the average value is taken as the color of the image area to be displayed. Assuming that the image area to be displayed includes pixel 1, pixel 2, pixel 3, and pixel 4, the first rendering color of pixel 1 is (R: 10, g:20, b: 30), the first rendering color of pixel 2 is (R: 15, g:18, b: 40), the first rendering color of pixel 3 is (R: 30, g:40, b: 50), and the first rendering color of pixel 4 is (R: 25, g:55, b: 60), the color of the image area to be displayed may be calculated as follows: r= (10+15+30+25)/4, g= (20+18+40+55)/4, b= (30+40+50+60)/4.
FIG. 8 is a flowchart illustrating a virtual object rendering method of a game according to an embodiment of the present application; optionally, in step S102, determining a color difference value between the to-be-displayed image areas corresponding to the virtual objects according to the first rendering color of each pixel point in the to-be-displayed image area corresponding to each virtual object may include:
s801, mapping the image areas to be displayed corresponding to the virtual objects into a color space according to the colors of the image areas to be displayed corresponding to the virtual objects, and determining mapping points of the image areas to be displayed corresponding to the virtual objects in the color space.
Wherein the color space is an RGB color space. Optionally, the image area to be displayed corresponding to the virtual object may be mapped into the color space based on the color of the image area to be displayed corresponding to the virtual object, so as to determine the mapping point of the image area to be displayed corresponding to the virtual object in the color space, so as to calculate the color difference value between the image areas to be displayed corresponding to the virtual objects through the mapping point.
S802, determining color difference values among the image areas to be displayed corresponding to the virtual objects according to the colors of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space.
Alternatively, the spatial distance between the virtual objects may be calculated by the color of the mapping point of the image area to be displayed corresponding to each virtual object in the color space, so that the spatial distance between the virtual objects is used as the color difference value between the image areas to be displayed corresponding to the virtual objects.
FIG. 9 is a flowchart of a virtual object rendering method of a game according to an embodiment of the present application; optionally, in step S801, mapping the image area to be displayed corresponding to each virtual object to a color space according to the color of the image area to be displayed corresponding to each virtual object, and determining the mapping point of the image area to be displayed corresponding to each virtual object in the color space may include:
And S901, determining three-dimensional coordinate information of mapping points of the image area to be displayed mapped to a color space according to the colors of the image area to be displayed corresponding to each virtual object.
Optionally, since the color of the image area to be displayed corresponding to the virtual object is an RGB value, it corresponds to a specific point in the three-dimensional color space, that is, the three-dimensional coordinate information of the point in the color space can be determined according to the color of the image area to be displayed corresponding to the virtual object.
S902, according to the three-dimensional coordinate information, determining mapping points of the image area to be displayed in a color space.
Based on the determined three-dimensional coordinate information, the location of a specific mapping point may be determined, thereby determining the mapping point of the image area to be displayed in the color space.
Optionally, in step S802, determining a color difference value between the image areas to be displayed corresponding to the virtual objects according to the colors of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space may include: and determining color difference values among the image areas to be displayed corresponding to the virtual objects by adopting an Euclidean distance calculation formula according to the color values of the red, green and blue three channels of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space.
In one implementation, a simplest euclidean distance calculation formula may be used to calculate a color difference value between the image areas to be displayed corresponding to each virtual object. Assuming that the color value of the red, green and blue three channels of the mapping point of the image area to be displayed corresponding to the first virtual object in the color space is (R1, G1, B1), and the color value of the red, green and blue three channels of the mapping point of the image area to be displayed corresponding to the second virtual object in the color space is (R2, G2, B2), the color difference value between the image area to be displayed corresponding to the first virtual object and the image area to be displayed corresponding to the second virtual object may be calculated as follows:
of course, in practical application, the calculation formula used includes, but is not limited to, the euclidean distance calculation formula, and other color difference value calculation methods may be adopted, which is not limited in the present application.
FIG. 10 is a flowchart illustrating a virtual object rendering method of a game according to an embodiment of the present application; optionally, the method of the present application may further comprise:
S1001, if the color of the image area to be displayed corresponding to the first virtual object is the same as the color of the image area to be displayed corresponding to the second virtual object, and the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object is different from the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object.
In some cases, for virtual objects with different initial setting colors, that is, a first virtual object and a second virtual object which are to be presented on a picture and have different rendering colors, due to different processing modes of different regional shadows or materials of the whole screen during rendering, the situation that the rendering colors of the first virtual object and the second virtual object which are presented on the picture are identical may occur, so that the color of an image region to be displayed corresponding to the first virtual object is the same as the color of the image region to be displayed corresponding to the second virtual object, so that the mapping point of the image region to be displayed corresponding to the first virtual object in the color space overlaps with the mapping point of the image region to be displayed corresponding to the second virtual object in the color space, thereby avoiding calculation of color difference values between the image region to be displayed corresponding to the first virtual object and the image region to be displayed corresponding to the first virtual object.
S1002, determining the color of the image area to be displayed according to the rendering color of each pixel point in the image area to be displayed corresponding to at least one first virtual object with the same initial setting color.
Alternatively, the color of the image area to be displayed may be calculated by taking the image areas to be displayed corresponding to all the virtual objects having the same initial setting color as a whole, for example: three virtual objects with green initial set colors respectively correspond to three image areas to be displayed, and the average value of the rendering colors of all pixel points in the three image areas to be displayed can be calculated to obtain the colors of the image areas to be displayed.
And S1003, taking the color of the image area to be displayed as the color of the image area to be displayed corresponding to each first virtual object.
Alternatively, the color of the image area to be displayed obtained by the calculation may be used as the color of the image area to be displayed corresponding to all the green virtual objects. The calculation of the colors of the image areas to be displayed of the virtual objects with other colors is similar to the calculation of the colors of the image areas to be displayed of the virtual objects with other colors, and detailed description is omitted.
FIG. 11 is a flowchart illustrating a virtual object rendering method of a game according to an embodiment of the present application; optionally, in step S301, adjusting the mapping point of the image area to be displayed corresponding to the first virtual object in the color space may include:
S1101, determining that the mapping points of the image areas to be displayed corresponding to the second virtual objects in the color space point to the connecting line directions of the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space.
Optionally, in the case of step S1001, since the calculation of the color of the image area to be displayed corresponding to the virtual object is updated, correspondingly, the adjustment of the mapping point of the image area to be displayed corresponding to the virtual object in the color space is updated.
S1102, determining an adjustment direction of a mapping point of an image area to be displayed, corresponding to a first virtual object, in a color space according to the connection direction.
S1103, according to the adjustment direction and the direction corresponding to the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object, the mapping point of the image area to be displayed corresponding to the first virtual object in the color space is adjusted.
Optionally, the implementation of this embodiment differs from the implementation of the foregoing steps S401 to S403 only in that, on the basis of determining the direction 1, the direction 2, and the direction 3, the direction corresponding to the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object is also added to the calculation, that is, the direction 1, the direction 2, and the direction 3, and the direction corresponding to the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object are subjected to the resultant force direction calculation, so as to comprehensively determine the adjustment direction. Wherein, the weight can be added to the direction corresponding to the initial setting color, and the weight can support the flexible adjustment of control.
In summary, the virtual object rendering method for a game provided in this embodiment includes: acquiring a plurality of virtual objects to be displayed; determining color difference values between the image areas to be displayed corresponding to the virtual objects according to the first rendering colors of the pixel points in the image areas to be displayed corresponding to the virtual objects; according to the color difference value between the image areas to be displayed corresponding to the virtual objects, adjusting the initial set color of each pixel point in the image area to be displayed corresponding to at least one target virtual object to obtain the target set color of each pixel point in the image area to be displayed corresponding to the target virtual object; and determining a second rendering color of the target virtual object according to the target setting color of each pixel point in the image area to be displayed corresponding to the target virtual object, and rendering and displaying the target virtual object by using the second rendering color. According to the method, based on the colors of the image areas to be displayed corresponding to the virtual objects, the color difference values among the image areas to be displayed corresponding to the virtual objects can be determined, when the color difference values do not meet the color difference conditions, the set colors of the pixel points in the image areas to be displayed corresponding to the virtual objects are adjusted to adjust the first rendering colors of the pixel points in the image areas to be displayed corresponding to the virtual objects, so that the virtual objects are generated based on the adjusted second rendering colors, dynamic adjustment of the rendering colors of the virtual objects can be achieved, the color difference degree among the virtual objects is effectively increased, color resolution of a game player on the virtual objects is clearer, and game experience of the player is improved.
The following describes a device, equipment, a storage medium, etc. for executing the virtual object rendering method of the game provided by the present application, and specific implementation processes and technical effects thereof are referred to above, which are not described in detail below.
Fig. 12 is a schematic diagram of a virtual object rendering device for a game according to an embodiment of the present application, where functions implemented by the virtual object rendering device for a game correspond to steps executed by the method described above. The apparatus may be understood as a terminal device or a server as described above, or a processor of a server, or may be understood as a component, which is independent from the server or the processor and performs the functions of the present application under the control of the server, and as shown in the figure, the apparatus may include: an acquisition module 120, a determination module 121, a rendering module 122;
an obtaining module 120, configured to obtain a plurality of virtual objects to be displayed;
A determining module 121, configured to determine a color difference value between the to-be-displayed image areas corresponding to the virtual objects according to the first rendering color of each pixel point in the to-be-displayed image area corresponding to each virtual object;
the obtaining module 120 is configured to adjust an initial set color of each pixel point in the image area to be displayed corresponding to at least one target virtual object according to a color difference value between the image areas to be displayed corresponding to each virtual object, so as to obtain a target set color of each pixel point in the image area to be displayed corresponding to the target virtual object, where the target virtual object is a virtual object to be displayed that does not satisfy a color difference condition, and a first rendering color of the pixel point is obtained based on the initial set color of the pixel point;
The rendering module 122 is configured to determine a second rendering color of the target virtual object according to the target setting color of each pixel point in the image area to be displayed corresponding to the target virtual object, and render and display the target virtual object using the second rendering color.
Optionally, the acquisition module 120 is specifically configured to
If the color difference value between the image area to be displayed corresponding to the first virtual object and the image area to be displayed corresponding to at least one second virtual object is smaller than a preset threshold value, determining the first virtual object and the second virtual object as target virtual objects, further adjusting the mapping points of the image area to be displayed corresponding to the first virtual object in a color space, and adjusting the mapping points of the image area to be displayed corresponding to each second virtual object in the color space, wherein the first virtual object is any one of the virtual objects, and the second virtual object is other virtual objects except the first virtual object;
According to the adjusted mapping points, determining new colors of the image areas to be displayed corresponding to the first virtual objects and new colors of the image areas to be displayed corresponding to the second virtual objects respectively;
And respectively adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to the second virtual object.
Optionally, the acquisition module 120 is specifically configured to
Respectively determining the connection direction of the mapping points of the image areas to be displayed corresponding to the second virtual objects in the color space to the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space;
According to the connecting line direction, determining the adjusting direction of the mapping point of the image area to be displayed, corresponding to the first virtual object, in the color space;
and according to the adjustment direction, adjusting the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space so that the color difference value between the image areas to be displayed corresponding to the first virtual objects and the image areas to be displayed corresponding to the second virtual objects is larger than or equal to a preset threshold value.
Optionally, the acquisition module 120 is specifically configured to
Determining a new set color of each pixel point in the image area to be displayed corresponding to the first virtual object and a new set color of each pixel point in the image area to be displayed corresponding to each second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to each second virtual object;
And respectively adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the new set color of each pixel point in the image area to be displayed corresponding to the second virtual object.
Optionally, the acquisition module 120 is specifically configured to
Determining the color of a mapping point of an image area to be displayed, which corresponds to a first virtual object, after adjustment in a color space;
taking the color of the mapping point of the image area to be displayed, corresponding to the first virtual object, after being adjusted in the color space as the new color of the image area to be displayed, corresponding to the first virtual object;
determining the color of the mapping point of the image area to be displayed, which corresponds to each second virtual object, after being adjusted in the color space;
and respectively taking the colors of the mapping points of the image areas to be displayed corresponding to the second virtual objects after adjustment in the color space as new colors of the image areas to be displayed corresponding to the second virtual objects.
Optionally, the apparatus further comprises: an adjustment module;
The adjustment module is used for not adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object if the color of the image area to be displayed corresponding to the first virtual object is determined to be the same as the color before adjustment of the mapping point according to the adjusted mapping point;
If the color of the image area to be displayed corresponding to the second virtual object is determined to be the same as the color before the adjustment of the mapping point according to the adjusted mapping point, the initial setting color of each pixel point in the image area to be displayed corresponding to the second virtual object is not adjusted.
Optionally, the determining module 121 is specifically configured to
And calculating an average value of the first rendering colors of the pixel points in the first image area to be displayed, wherein the average value is used as the color of the first image area to be displayed, and the first image area to be displayed is the image area to be displayed corresponding to any virtual object.
Optionally, the determining module 121 is specifically configured to
According to the colors of the image areas to be displayed corresponding to the virtual objects, mapping the image areas to be displayed corresponding to the virtual objects into a color space respectively, and determining mapping points of the image areas to be displayed corresponding to the virtual objects in the color space, wherein the color space is RGB color space;
and determining color difference values among the image areas to be displayed corresponding to the virtual objects according to the colors of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space.
Optionally, the determining module 121 is specifically configured to
According to the colors of the image areas to be displayed corresponding to the virtual objects, determining three-dimensional coordinate information of mapping points of the image areas to be displayed, which are mapped to a color space;
And determining the mapping points of the image area to be displayed in the color space according to the three-dimensional coordinate information.
Optionally, the determining module 121 is specifically configured to
And determining color difference values among the image areas to be displayed corresponding to the virtual objects by adopting an Euclidean distance calculation formula according to the color values of the red, green and blue three channels of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space.
Optionally, the determining module 121 is further configured to
If the color of the image area to be displayed corresponding to the first virtual object is the same as the color of the image area to be displayed corresponding to the second virtual object, and the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object is different from the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object;
determining the color of the image area to be displayed according to the rendering color of each pixel point in the image area to be displayed corresponding to at least one first virtual object with the same initial setting color;
and taking the color of the image area to be displayed as the color of the image area to be displayed corresponding to each first virtual object.
Optionally, the obtaining module 120 is further configured to
Respectively determining the connection direction of the mapping points of the image areas to be displayed corresponding to the second virtual objects in the color space to the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space;
According to the connecting line direction, determining the adjusting direction of the mapping point of the image area to be displayed, corresponding to the first virtual object, in the color space;
And adjusting the mapping point of the image area to be displayed corresponding to the first virtual object in the color space according to the adjustment direction and the direction corresponding to the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object.
The foregoing apparatus is used for executing the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, and are not described herein again.
The above modules may be one or more integrated circuits configured to implement the above methods, for example: one or more Application SPECIFIC INTEGRATED Circuits (ASIC), or one or more microprocessors (DIGITAL SINGNAL processor, DSP), or one or more field programmable gate arrays (Field Programmable GATE ARRAY, FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
The modules may be connected or communicate with each other via wired or wireless connections. The wired connection may include a metal cable, optical cable, hybrid cable, or the like, or any combination thereof. The wireless connection may include a connection through a LAN, WAN, bluetooth, zigBee, or NFC, or any combination thereof. Two or more modules may be combined into a single module, and any one module may be divided into two or more units. It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the method embodiments, and are not repeated in the present disclosure.
It should be noted that these above modules may be one or more integrated circuits configured to implement the above methods, for example: one or more Application SPECIFIC INTEGRATED Circuits (ASIC), or one or more microprocessors (DIGITAL SINGNAL Processor DSP), or one or more field programmable gate arrays (Field Programmable GATE ARRAY FPGA), etc. For another example, when a module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a System-on-a-chip (SOC).
Fig. 13 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the device may be a computing device with a data processing function.
The apparatus includes: a processor 801, and a memory 802.
The memory 802 is used for storing a program, and the processor 801 calls the program stored in the memory 802 to execute the above-described method embodiment. The specific implementation manner and the technical effect are similar, and are not repeated here.
Therein, the memory 802 stores program code that, when executed by the processor 801, causes the processor 801 to perform various steps in the methods according to various exemplary embodiments of the application described in the above section of the description of exemplary methods.
The Processor 801 may be a general purpose Processor such as a Central Processing Unit (CPU), digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field programmable gate array (Field Programmable GATE ARRAY, FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution.
Memory 802, as a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory may include at least one type of storage medium, which may include, for example, flash Memory, hard disk, multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM), magnetic Memory, magnetic disk, optical disk, and the like. The memory is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 802 of embodiments of the present application may also be circuitry or any other device capable of performing storage functions for storing program instructions and/or data.
Optionally, the present application also provides a program product, such as a computer readable storage medium, comprising a program for performing the above-described method embodiments when being executed by a processor.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform some of the steps of the methods according to the embodiments of the application. And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.

Claims (14)

1. A method of rendering virtual objects for a game, the method comprising:
Acquiring a plurality of virtual objects to be displayed;
Determining color difference values between the image areas to be displayed corresponding to the virtual objects according to the first rendering colors of the pixel points in the image areas to be displayed corresponding to the virtual objects;
According to color difference values among image areas to be displayed corresponding to the virtual objects, adjusting initial set colors of pixel points in the image areas to be displayed corresponding to at least one target virtual object to obtain target set colors of the pixel points in the image areas to be displayed corresponding to the target virtual object, wherein the target virtual object is a virtual object to be displayed which does not meet color difference conditions, and the first rendering color of the pixel points is obtained based on the initial set colors of the pixel points;
Determining a second rendering color of the target virtual object according to the target setting color of each pixel point in the image area to be displayed corresponding to the target virtual object, and rendering and displaying the target virtual object by using the second rendering color;
The adjusting the initial setting color of each pixel point in the image area to be displayed corresponding to at least one target virtual object according to the color difference value between the image areas to be displayed corresponding to each virtual object comprises:
If the color difference value between the image area to be displayed corresponding to the first virtual object and the image area to be displayed corresponding to at least one second virtual object is smaller than a preset threshold value, determining the first virtual object and the second virtual object as target virtual objects, further adjusting the mapping points of the image area to be displayed corresponding to the first virtual object in a color space, and adjusting the mapping points of the image area to be displayed corresponding to each second virtual object in the color space, wherein the first virtual object is any one of the virtual objects, and the second virtual object is other virtual objects except the first virtual object;
According to the adjusted mapping points, determining new colors of the image areas to be displayed corresponding to the first virtual objects and new colors of the image areas to be displayed corresponding to the second virtual objects respectively;
And respectively adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to the second virtual object.
2. The method according to claim 1, wherein adjusting the mapping point of the image area to be displayed corresponding to the first virtual object in the color space comprises:
respectively determining the connection direction of the mapping points of the image areas to be displayed corresponding to the second virtual objects in the color space to the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space;
according to the connecting line direction, determining an adjustment direction of a mapping point of the image area to be displayed, corresponding to the first virtual object, in a color space;
And according to the adjustment direction, adjusting the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space so that the color difference value between the image areas to be displayed corresponding to the first virtual objects and the image areas to be displayed corresponding to the second virtual objects is larger than or equal to a preset threshold value.
3. The method according to claim 1, wherein the adjusting the initial setting color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial setting color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to each second virtual object includes:
Determining a new set color of each pixel point in the image area to be displayed corresponding to the first virtual object and a new set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to the second virtual object;
And respectively adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the new set color of each pixel point in the image area to be displayed corresponding to the second virtual object.
4. The method according to claim 1, wherein the determining the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to each second virtual object according to the adjusted mapping points includes:
determining the color of a mapping point of the image area to be displayed, which corresponds to the first virtual object, after being adjusted in a color space;
Taking the color of the mapping point of the image area to be displayed, corresponding to the first virtual object, after being adjusted in the color space as the new color of the image area to be displayed, corresponding to the first virtual object;
determining the color of the mapping point of the image area to be displayed, which corresponds to each second virtual object, after being adjusted in the color space;
and taking the colors of the mapping points of the image areas to be displayed corresponding to the second virtual objects after the adjustment in the color space as the new colors of the image areas to be displayed corresponding to the second virtual objects.
5. The method according to claim 1, wherein after the adjusting the mapping points of the image area to be displayed corresponding to the first virtual object in the color space and the adjusting the mapping points of the image area to be displayed corresponding to each second virtual object in the color space, the method further comprises:
If the color of the image area to be displayed corresponding to the first virtual object is determined to be the same as the color before the adjustment of the mapping point according to the adjusted mapping point, the initial setting color of each pixel point in the image area to be displayed corresponding to the first virtual object is not adjusted;
If the color of the image area to be displayed corresponding to the second virtual object is determined to be the same as the color before the adjustment of the mapping point according to the adjusted mapping point, the initial setting color of each pixel point in the image area to be displayed corresponding to the second virtual object is not adjusted.
6. The method according to any one of claims 1 to 5, wherein determining the color difference value between the image areas to be displayed corresponding to the virtual objects according to the first rendering color of each pixel point in the image areas to be displayed corresponding to the virtual objects includes:
and calculating an average value of the first rendering colors of the pixel points in the first image area to be displayed, and taking the average value as the color of the first image area to be displayed, wherein the first image area to be displayed is the image area to be displayed corresponding to any virtual object.
7. The method according to claim 6, wherein determining the color difference value between the image areas to be displayed corresponding to the virtual objects according to the first rendering color of each pixel point in the image areas to be displayed corresponding to the virtual objects comprises:
According to the colors of the image areas to be displayed corresponding to the virtual objects, mapping the image areas to be displayed corresponding to the virtual objects into a color space respectively, and determining mapping points of the image areas to be displayed corresponding to the virtual objects in the color space, wherein the color space is an RGB color space;
And determining color difference values among the image areas to be displayed corresponding to the virtual objects according to the colors of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space.
8. The method according to claim 7, wherein the mapping the image area to be displayed corresponding to each virtual object to the color space according to the color of the image area to be displayed corresponding to each virtual object, and determining the mapping point of the image area to be displayed corresponding to each virtual object in the color space comprises:
according to the colors of the image areas to be displayed corresponding to the virtual objects, determining three-dimensional coordinate information of mapping points of the image areas to be displayed, which are mapped to a color space;
And determining the mapping points of the image area to be displayed in the color space according to the three-dimensional coordinate information.
9. The method according to claim 8, wherein the determining the color difference value between the image areas to be displayed corresponding to the virtual objects according to the colors of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space includes:
and determining color difference values among the image areas to be displayed corresponding to the virtual objects by adopting an Euclidean distance calculation formula according to the color values of the red, green and blue three channels of the mapping points of the image areas to be displayed corresponding to the virtual objects in the color space.
10. The method according to claim 1, wherein the method further comprises:
If the color of the image area to be displayed corresponding to the first virtual object is the same as the color of the image area to be displayed corresponding to the second virtual object, and the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object is different from the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object;
Determining the color of the image area to be displayed according to the first rendering color of each pixel point in the image area to be displayed corresponding to at least one first virtual object with the same initial setting color;
And taking the color of the image area to be displayed as the color of the image area to be displayed corresponding to each first virtual object.
11. The method of claim 10, wherein adjusting the mapping point of the image area to be displayed corresponding to the first virtual object in the color space comprises:
respectively determining the connection direction of the mapping points of the image areas to be displayed corresponding to the second virtual objects in the color space to the mapping points of the image areas to be displayed corresponding to the first virtual objects in the color space;
according to the connecting line direction, determining an adjustment direction of a mapping point of the image area to be displayed, corresponding to the first virtual object, in a color space;
And adjusting the mapping point of the image area to be displayed corresponding to the first virtual object in a color space according to the adjustment direction and the direction corresponding to the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object.
12. A virtual object rendering apparatus for a game, wherein a graphic user interface in which a plurality of virtual objects are displayed is provided through a terminal device, the apparatus comprising: the device comprises an acquisition module, a determination module and a rendering module;
the acquisition module is used for acquiring a plurality of virtual objects to be displayed;
The determining module is used for determining color difference values between the image areas to be displayed corresponding to the virtual objects according to the first rendering colors of the pixel points in the image areas to be displayed corresponding to the virtual objects;
the obtaining module is configured to adjust an initial set color of each pixel point in the image area to be displayed corresponding to at least one target virtual object according to a color difference value between the image areas to be displayed corresponding to each virtual object, so as to obtain a target set color of each pixel point in the image area to be displayed corresponding to the target virtual object, where the target virtual object is a virtual object to be displayed that does not meet a color difference condition, and a first rendering color of the pixel point is obtained based on the initial set color of the pixel point;
The rendering module is used for determining a second rendering color of the target virtual object according to target setting colors of all pixel points in the image area to be displayed corresponding to the target virtual object, and rendering and displaying the target virtual object by using the second rendering color;
The obtaining module is specifically configured to determine a first virtual object and a second virtual object as target virtual objects if a color difference value between an image area to be displayed corresponding to the first virtual object and an image area to be displayed corresponding to at least one second virtual object is smaller than a preset threshold, and further adjust a mapping point of the image area to be displayed corresponding to the first virtual object in a color space, and adjust a mapping point of the image area to be displayed corresponding to each second virtual object in the color space, where the first virtual object is any one of the virtual objects, and the second virtual object is other virtual objects except the first virtual object; according to the adjusted mapping points, determining new colors of the image areas to be displayed corresponding to the first virtual objects and new colors of the image areas to be displayed corresponding to the second virtual objects respectively; and respectively adjusting the initial set color of each pixel point in the image area to be displayed corresponding to the first virtual object and the initial set color of each pixel point in the image area to be displayed corresponding to the second virtual object according to the new color of the image area to be displayed corresponding to the first virtual object and the new color of the image area to be displayed corresponding to the second virtual object.
13. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing program instructions executable by the processor, the processor and the storage medium communicating over the bus when the electronic device is running, the processor executing the program instructions to perform the steps of the method according to any one of claims 1 to 11 when executed.
14. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when executed by a processor, performs the steps of the method according to any of claims 1 to 11.
CN202110975278.0A 2021-08-24 2021-08-24 Game virtual object rendering method, device, equipment and storage medium Active CN113648653B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110975278.0A CN113648653B (en) 2021-08-24 2021-08-24 Game virtual object rendering method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110975278.0A CN113648653B (en) 2021-08-24 2021-08-24 Game virtual object rendering method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113648653A CN113648653A (en) 2021-11-16
CN113648653B true CN113648653B (en) 2024-05-28

Family

ID=78481826

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110975278.0A Active CN113648653B (en) 2021-08-24 2021-08-24 Game virtual object rendering method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113648653B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117478802A (en) * 2023-10-30 2024-01-30 神力视界(深圳)文化科技有限公司 Image processing method and device and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002355415A (en) * 2001-05-31 2002-12-10 Aruze Corp Game machine, performance expression method for game machine, storage medium and server
CN102099085A (en) * 2008-05-15 2011-06-15 微软公司 Visual feedback in electronic entertainment system
CN103295560A (en) * 2012-02-24 2013-09-11 联想(北京)有限公司 Terminal device and display adjusting method thereof
CN105243684A (en) * 2015-09-10 2016-01-13 网易(杭州)网络有限公司 Method of displaying image in game interface and device
CN105719318A (en) * 2016-01-26 2016-06-29 上海葡萄纬度科技有限公司 Educational toy set and HSV based color identification method for Rubik's cube
JP2018029867A (en) * 2016-08-26 2018-03-01 株式会社バンダイナムコエンターテインメント Game system and program
CN111530085A (en) * 2020-05-06 2020-08-14 网易(杭州)网络有限公司 Game role dyeing method, device, equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002355415A (en) * 2001-05-31 2002-12-10 Aruze Corp Game machine, performance expression method for game machine, storage medium and server
CN102099085A (en) * 2008-05-15 2011-06-15 微软公司 Visual feedback in electronic entertainment system
CN103295560A (en) * 2012-02-24 2013-09-11 联想(北京)有限公司 Terminal device and display adjusting method thereof
CN105243684A (en) * 2015-09-10 2016-01-13 网易(杭州)网络有限公司 Method of displaying image in game interface and device
CN105719318A (en) * 2016-01-26 2016-06-29 上海葡萄纬度科技有限公司 Educational toy set and HSV based color identification method for Rubik's cube
JP2018029867A (en) * 2016-08-26 2018-03-01 株式会社バンダイナムコエンターテインメント Game system and program
CN111530085A (en) * 2020-05-06 2020-08-14 网易(杭州)网络有限公司 Game role dyeing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN113648653A (en) 2021-11-16

Similar Documents

Publication Publication Date Title
EP3951721A1 (en) Method and apparatus for determining occluded area of virtual object, and terminal device
CN104718528B (en) Determine the method, apparatus and terminal device of the color of interface control
CN112316420B (en) Model rendering method, device, equipment and storage medium
KR102048885B1 (en) Graphic processing unit, graphic processing system comprising the same, rendering method using the same
US11308655B2 (en) Image synthesis method and apparatus
JP2008077627A (en) Method and system for early z test in three-dimensional image rendering
CN111494934B (en) Method, device, terminal and storage medium for displaying virtual prop in game
CN105005970A (en) Augmented reality implementation method and apparatus
CN113648653B (en) Game virtual object rendering method, device, equipment and storage medium
KR102251444B1 (en) Graphic processing unit, graphic processing system comprising the same, antialiasing method using the same
CN105631923A (en) Rendering method and device
CN110662012A (en) Naked eye 3D display effect optimization drawing arranging method and system and electronic equipment
CN115375815A (en) Shadow rendering method and device, electronic equipment and storage medium
CN106598250A (en) VR display method and apparatus, and electronic device
CN110889384A (en) Scene switching method and device, electronic equipment and storage medium
CN113786607A (en) Interface display method, device, terminal and storage medium
CN107644451B (en) Animation display method and device
JP5950701B2 (en) Image display system, puzzle game system, image display method, puzzle game method, image display device, puzzle game device, image display program, and puzzle game program
CN113126944B (en) Depth map display method, display device, electronic device, and storage medium
EP3154028A1 (en) Method and device for displaying illumination
CN113703653A (en) Image processing method, device, equipment and computer readable storage medium
CN111870950B (en) Game control display control method and device and electronic equipment
CN114066715A (en) Image style migration method and device, electronic equipment and storage medium
US10825200B2 (en) Texture based pixel count determination
JPWO2021154558A5 (en)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant