CN113181639A - Method and device for processing graphics in game - Google Patents

Method and device for processing graphics in game Download PDF

Info

Publication number
CN113181639A
CN113181639A CN202110470301.0A CN202110470301A CN113181639A CN 113181639 A CN113181639 A CN 113181639A CN 202110470301 A CN202110470301 A CN 202110470301A CN 113181639 A CN113181639 A CN 113181639A
Authority
CN
China
Prior art keywords
texture
texture map
color
map
mapping
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.)
Granted
Application number
CN202110470301.0A
Other languages
Chinese (zh)
Other versions
CN113181639B (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 CN202110470301.0A priority Critical patent/CN113181639B/en
Publication of CN113181639A publication Critical patent/CN113181639A/en
Application granted granted Critical
Publication of CN113181639B publication Critical patent/CN113181639B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation
    • G06T15/205Image-based rendering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/80Shading
    • G06T15/87Gouraud shading
    • 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/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
    • A63F2300/6692Methods for processing data by generating or executing the game program for rendering three dimensional images using special effects, generally involving post-processing, e.g. blooming

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • Multimedia (AREA)
  • Computing Systems (AREA)
  • Geometry (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Generation (AREA)

Abstract

The embodiment of the invention provides a method and a device for processing graphics in a game, wherein the method comprises the following steps: twisting an initial texture map in the game to obtain a twisted texture map; subtracting the initial texture map and the distorted texture map to obtain a difference texture map; carrying out color adjustment on the difference texture mapping to obtain a color texture mapping; and overlapping the color texture mapping and the distorted texture mapping to obtain a target texture mapping. Therefore, only one map (namely the initial texture map) is needed to be used for processing to obtain the target texture map, and the target texture map is rendered to have a fault distortion effect in a game scene, so that the method is very simple and efficient.

Description

Method and device for processing graphics in game
Technical Field
The present invention relates to the field of graphics processing technologies, and in particular, to a graphics processing method in a game and a graphics processing apparatus in a game.
Background
With the increase of the technical style games of the Saibop and Penker, for example, < Saibop and Penker 2077>, < watchdog >, < mission Call > and so on, many games are set in the world view of the future technical world, and meanwhile, the special effects of holographic projection, neon lights, fault effects and so on according with the world view are very important.
At present, the fault effect is generally realized by a way of post-stage software production, but the way is largely used in the film and television industry, for example, fig. 1A to 1C are schematic diagrams of the fault effect realized in the film and television industry, and the way of realizing the fault effect cannot be efficiently restored into the game, and the way of post-stage software production needs to use a large number of maps, which consumes a large amount of human resources, if a single map is used, a variety of environments and effects in the future scientific and technological world cannot be expressed, and the way of post-stage software production cannot be generally used in 2D games and 3D games.
Disclosure of Invention
In view of the above-mentioned problem that the method for making fault effect images by post-stage software cannot be quickly restored to a game, and the method consumes a lot of human resources due to being implemented by using a lot of maps, and cannot present diversified environments and effects in the future technical world if a single map is used, embodiments of the present invention are proposed to provide a graphics processing method in a game and a graphics processing apparatus in a game, which overcome or at least partially solve the above-mentioned problem.
The embodiment of the invention discloses a method for processing graphics in a game, which comprises the following steps:
twisting an initial texture map in the game to obtain a twisted texture map;
subtracting the initial texture map and the distorted texture map to obtain a difference texture map;
carrying out color adjustment on the difference texture mapping to obtain a color texture mapping;
and overlapping the color texture mapping and the distorted texture mapping to obtain a target texture mapping.
Optionally, the warping texture map includes a plurality of pieces, and the warping an initial texture map in the game to obtain the warping texture map includes:
and setting different UV offset values for the initial texture mapping, and performing UV offset on the initial texture mapping according to the different UV offset values respectively to obtain a plurality of distorted texture mappings.
Optionally, the method further comprises:
processing the plurality of distorted texture maps respectively to obtain a plurality of corresponding target texture maps;
and at different times, rendering the multiple target texture maps in the game respectively to present a fault distortion animation effect.
Optionally, the subtracting the initial texture map and the warped texture map to obtain a difference texture map includes:
and subtracting the color values of the preset channels of the distorted texture map and the initial texture map to obtain a difference texture map.
Optionally, the performing color adjustment according to the difference texture map to obtain a color texture map includes:
mapping color values of the difference texture map to between 0 and 1;
and coloring the difference texture mapping by adopting a preset color value to obtain a color texture mapping.
Optionally, the mapping the color value of the difference texture map to between 0 and 1 includes:
the color values of the difference texture map are mapped between 0 and 1 by the saturrate function.
Optionally, coloring the difference texture map by using a preset color value to obtain a color texture map, including:
generating a fault color map according to the preset color value;
and multiplying the fault color mapping and the difference value texture mapping to obtain a color texture mapping.
The embodiment of the invention also discloses a graphics processing device in the game, which comprises:
the distortion processing module is used for carrying out distortion processing on an initial texture map in the game to obtain a distorted texture map;
a subtraction processing module, configured to perform subtraction processing on the initial texture map and the warped texture map to obtain a difference texture map;
the color adjusting module is used for adjusting colors according to the difference texture mapping to obtain a color texture mapping;
and the superposition processing module is used for carrying out superposition processing on the color texture mapping and the distorted texture mapping to obtain a target texture mapping.
The embodiment of the invention also discloses an electronic device, which comprises:
the device comprises a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, when an electronic device runs, the processor is communicated with the storage medium through the bus, and the processor executes the machine-readable instructions to execute the method according to any one of the embodiment of the invention.
The embodiment of the invention also discloses a computer readable storage medium, wherein a computer program is stored on the storage medium, and when the computer program is executed by a processor, the method of any one of the embodiments of the invention is executed.
The embodiment of the invention has the following advantages:
in the embodiment of the invention, an initial texture map in a game is distorted to obtain a distorted texture map, the initial texture map and the distorted texture map are subtracted to obtain a difference texture map, then the color of the difference texture map is adjusted to obtain a color texture map, and the color texture map and the distorted texture map are superposed to obtain a target texture map, so that a fault distortion effect can be presented in a game scene by rendering the target texture map.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the description of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1A is a schematic diagram of fault-specific effects implemented in the film and television industry in the prior art;
FIG. 1B is a schematic diagram of fault-specific effects implemented in the film and television industry in the prior art;
FIG. 1C is a schematic diagram of the failure specific effect implemented in the film and television industry of the prior art;
FIG. 2 is a flow chart illustrating steps of a method for processing graphics in a game according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a rendered texture map according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a preset warped special effect map according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a warped texture map according to an embodiment of the present invention;
FIG. 6 is a flow chart of steps of another method for graphics processing in a game, according to an embodiment of the present invention;
FIG. 7 is a flow chart of a method for processing graphics in a game according to an embodiment of the present invention;
FIG. 8 is a block diagram of an in-game graphics processing apparatus according to an embodiment of the present invention;
fig. 9 is a block diagram of an electronic device according to an embodiment of the present invention;
fig. 10 is a block diagram of a storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problems that the method for making fault special effect images through post-stage software in the prior art cannot be quickly restored into a game, and the method consumes a large amount of human resources due to being realized by using a large number of maps, and cannot show various environments and effects in the future technical world if a single map is used, the embodiment of the invention provides a method for processing graphics in the game, which obtains a Render Texture rendering map corresponding to a game scene, and then performs distortion processing, subtraction processing, color adjustment and superposition processing on the Render Texture to obtain a target Texture map, so that the fault distortion effect can be presented in the game scene by rendering the target Texture map, and the Render Texture can perform multiple times of distortion processing, subtraction processing, color adjustment and superposition processing to obtain multiple target Texture maps, to present dynamic failure effects by rendering multiple target texture maps. The image processing method of the embodiment of the invention can obtain the target Texture mapping with the special effect of fault distortion by processing one initial Texture mapping, is very simple and efficient, can match different environments such as various virtual roles, game scenes, UI (user interface) and the like in a game, is suitable for various game scenes such as hand games, end games and the like, and is convenient and quick.
Referring to fig. 2, a flowchart illustrating steps of a method for processing graphics in a game according to an embodiment of the present invention is shown, where the method specifically includes the following steps:
step 201, performing distortion processing on an initial texture map in a game to obtain a distorted texture map;
the initial texture map is a map corresponding to a game scene for realizing a special fault distortion effect, and the game scene may include contents such as a virtual Character, an architectural model, or a carrier model, where the virtual Character is a game virtual unit controlled by a player through a terminal device in the game scene, and may also be an NPC (Non-playing Character) preset in a specific game scene by a game developer. The building model can be a house model, a wall model or a billboard of a roof in a game scene. The vehicle model is a model of a vehicle in a game scene, and includes a motorcycle, a car, a bouncing vehicle, and the like.
Specifically, an initial Texture map corresponding to the game scene may be obtained first, and in one example, the initial Texture map may be a Render Texture, where the Render Texture is a Texture map on which a Texture may be dynamically drawn, and then the Render Texture may be a target of a camera view as if other textures were used, so that the camera can draw the shot Texture onto the Texture. In a specific implementation, generally, three-dimensional computer graphics software provides a function of obtaining Render Texture, for example, a development tool such as Unity or Zbrush may create a camera in the three-dimensional computer graphics software, and obtain an initial Texture map corresponding to a game scene through the created camera. As shown in fig. 3, the initial texture map obtained by the camera contains a virtual character.
Since the normal picture will have a distortion effect in the failure state, after the initial texture map is obtained, the initial texture map is further distorted to obtain a distorted texture map. Specifically, UV of the initial texture map may be perturbed by means of UV offset to obtain a distorted texture map, where the UV is texture coordinates, where U represents an abscissa of the texture and V represents an ordinate of the texture, and the initial texture map is UV offset according to a preset offset algorithm to obtain the distorted texture map, so as to implement distortion of the game scene. In a specific implementation, the U value can be set to be shifted separately to realize left-right twisting in the horizontal direction, the V value can be set to be shifted separately to realize up-down twisting in the vertical direction, and the U value and the V value can be set to be shifted to realize twisting in the horizontal direction and the vertical direction simultaneously, as required by an actual twisting effect. Fig. 4 is a schematic diagram of a warped texture map according to an embodiment of the present invention, and the original texture map in fig. 4 is processed as UV left-right warping.
In a specific implementation, the three-dimensional computer graphics software provides UV processing functions, for example, the initial texture map may be imported into Unity, and the initial texture map may be warped by a shader of Unity to obtain a warped texture map. Fig. 5 is a schematic diagram of another warped texture map according to an embodiment of the present invention.
Step 202, subtracting the initial texture map and the distorted texture map to obtain a difference texture map;
specifically, the initial texture map corresponds to a normal state map before starting processing, the warped texture map corresponds to a map having a warped effect after being warped, and a difference texture map is obtained by subtracting the initial texture map and the warped texture map, wherein the difference texture map includes different partial contents, namely warped partial contents, in the initial texture map and the warped texture map.
In a specific implementation, the original texture map and the distorted texture map may be subtracted through an image subtraction processing function provided by three-dimensional computer graphics software, for example, in a shader of Unity, the distorted texture map and the original texture map are respectively connected to a substructure, and the subtraction between the two maps may be implemented through the function of the substructure, specifically, if the substructure includes two child nodes a and B, the distorted texture map is connected to a of the substructure, and the original texture map is connected to B of the substructure, so that the distorted texture map is subtracted from the original texture map through the substructure to obtain a differential texture map. As an example, assuming that the initial Texture map is a Render Texture obtained for a virtual object in the game, the difference Texture map obtained by subtracting the initial Texture map and the warped Texture map contains the warped virtual object.
Step 203, adjusting the color of the difference texture map to obtain a color texture map;
since the color of the normal picture in the failure state may be represented as a color specific to the failure, for example, the picture in the failure state may be represented as blue or red, in the embodiment of the present invention, the color texture map may be obtained by performing color adjustment on the difference texture map, so that the color of the color texture map represents a color effect specific to the failure state.
In a specific implementation, the color adjustment of the difference texture map may be performed through an image multiplication function provided by three-dimensional computer graphics software, for example, in a shader of Unity, the color adjustment of the difference texture map is performed through a multiplex node. Specifically, a required map of the Color effect in the fault state may be set by the bite Color node, for example, if a blue effect in the fault state is required, a blue map may be created by the bite Color node, and then the map and the difference texture map obtained by the bite Color node may be connected to the multiplex node, so that the Color texture map having the specific Color effect in the fault state may be obtained.
And 204, overlapping the color texture map and the distorted texture map to obtain a target texture map.
In the embodiment of the present invention, after performing color adjustment on the difference texture map, the color texture map and the distorted texture map may be superimposed to obtain a target texture map, which is an effect map in a required failure state, and the target texture map is rendered in a game scene to present a failure distortion effect.
In a specific implementation, the color texture map and the distorted texture map are superimposed through an image superimposing function provided by three-dimensional computer graphics software, for example, in a shader of Unity, the superimposed color texture map and the distorted texture map are implemented through an Add node, specifically, the Add node includes two child nodes, i.e., a node a and a node B, the color texture map is connected to the node a of the Add node, and the distorted texture map is connected to the node B of the Add node, so that the color texture map and the distorted texture map are continuously superimposed through the Add node to obtain a target texture map.
In the embodiment of the invention, an initial texture map in a game is distorted to obtain a distorted texture map, the initial texture map and the distorted texture map are subtracted to obtain a difference texture map, then the color of the difference texture map is adjusted to obtain a color texture map, and the color texture map and the distorted texture map are superposed to obtain a target texture map, so that a fault distortion effect can be presented in a game scene by rendering the target texture map.
According to the graphics processing scheme in the game provided by the embodiment of the invention, the Render Texture can be respectively subjected to twisting processing, subtraction processing, color adjustment and superposition processing for multiple times to obtain multiple target Texture maps, so that the multiple target Texture maps can be rendered at different moments to present a dynamic fault effect.
In a preferred embodiment of the present invention, the distorted texture map includes a plurality of pieces, and the step 201 may specifically include the following sub-steps:
and setting different UV offset values for the initial texture mapping, and performing UV offset on the initial texture mapping according to the different UV offset values respectively to obtain a plurality of distorted texture mappings.
Wherein the UV offset value is used to control a value of offsetting the UV coordinates of the vertex.
Specifically, different UV offset algorithms are set, the UV offset algorithm is used for determining a UV offset value corresponding to each vertex, and UV offset is performed on the initial texture map according to the UV offset value to obtain a plurality of distorted texture maps, wherein each UV offset algorithm can correspondingly obtain one distorted texture map.
As an example, assuming that four warped texture maps need to be generated, four different UV offset algorithms may be set, four different UV offset values are calculated for the initial texture map by using the four UV offset algorithms, and then the initial texture map is UV-offset according to the four different UV offset values to obtain the four warped texture maps.
In a preferred embodiment of the present invention, the method may further comprise the steps of:
processing the plurality of distorted texture maps respectively to obtain a plurality of corresponding target texture maps; and at different times, rendering the multiple target texture maps in the game respectively to present a fault distortion animation effect.
In the embodiment of the present invention, the processing procedures of the above steps 202-204, including subtraction processing, color adjustment and superposition processing, may be respectively performed on a plurality of distorted texture maps to obtain a plurality of corresponding target texture maps, and further, at different times, a plurality of target texture maps may be respectively rendered in a game to present a failure distortion animation effect.
As an example, assuming there are four warped texture maps, four difference texture maps may be obtained by performing subtraction on the four warped texture maps and the initial texture map, then four color texture maps may be obtained by performing color adjustment on the four texture maps, and finally, four color texture maps and the corresponding four warped texture maps may be superimposed to obtain the corresponding four target texture maps.
In a preferred embodiment of the present invention, the step 202 may specifically include the following sub-steps:
and subtracting the color values of the preset channels of the distorted texture map and the initial texture map to obtain a difference texture map.
When the warped texture map and the original texture map are subjected to subtraction processing, color values of preset channels in the warped texture map and the original texture map may be subtracted, where the preset channels may refer to preset color channels. In a specific implementation, the color space of the map is usually represented as RGBA four channels, where R represents Red, G represents Green, B represents Blue, and a represents Alpha transparency, and the preset channel may be set according to the actual situation of the map, which is not limited in this embodiment of the present invention.
In an example, assuming that the predetermined channel is an R channel, the color values of the R channel of each pixel point in the warped texture map and the initial texture map are subtracted, and the color values of the remaining channels (i.e., GBA channels) are set to 0, so as to obtain a difference texture map.
In a preferred embodiment of the present invention, the step 203 may specifically include the following sub-steps:
mapping color values of the difference texture map to between 0 and 1; and coloring the difference texture mapping by adopting a preset color value to obtain a color texture mapping.
To increase the purity of the color of the map, the color value of the difference texture map may be normalized by mapping the color value of the difference texture map between 0 and 1, and in a specific implementation, mapping the color value of the difference texture map between 0 and 1 may be implemented by a saturrate function. As an example, in the shader of Unity, the color values of the difference texture map may be mapped between 0 and 1 by the color processing function provided by the Saturate node.
After the color value of the difference texture map is normalized, the difference texture map can be colored by adopting a preset color value to obtain a color texture map, so that the color texture map has a special color effect in a fault state. The preset color value may be a preset color value for representing a specific color effect in a fault state, for example, the preset color value may be (13, 179, 255).
As an example, in a shader of Unity, coloring the difference texture map by using a preset Color value through a glint Color node and a multiplex node to obtain a Color texture map. A blue map is created through the bite Color node, and then the map and the differential texture map obtained by the bite Color node are connected to the multiplex node, so that a Color texture map having a Color effect specific to a failure state can be obtained.
In a preferred embodiment of the present invention, the mapping the color value of the difference texture map to between 0 and 1 includes:
the color values of the difference texture map are mapped between 0 and 1 by the saturrate function.
The Saturate function is used for standardizing the numerical value to be between 0 and 1, and for the color value of each pixel point, if the color value is smaller than 0, the return value is 0, if the color value is larger than 1, the return value is 1, and if the color value is between 0 and 1, the color value is directly returned. In an embodiment of the present invention, the color value of the difference texture map may be mapped between 0 and 1 by a saturrate function.
As an example, in the shader of Unity, after the subtraction processing is performed on the warped texture map and the initial texture map by connecting the substact node, the substact node may be further connected to a saturrate node, and the mapping of the color value of the differential texture map obtained after the processing by the substact node to between 0 and 1 is implemented by the saturrate node.
In a preferred embodiment of the present invention, coloring the difference texture map by using a preset color value to obtain a color texture map includes:
generating a fault color map according to the preset color value; and multiplying the fault color mapping and the difference texture mapping to obtain a color texture mapping.
Specifically, the generation of the fault Color map according to the preset Color value can be realized through the glint Color function, and the multiplication processing of the fault Color map and the difference texture map is realized through the multiplex function to obtain the Color texture map, so that the Color texture map has the specific Color effect in the fault state.
As an example, in a shader of Unity, generating a failure Color map according to a preset Color value may be implemented by connecting a glint Color node, setting a required Color value in the glint Color node, generating a failure Color map for the Color value, further connecting the glint Color node to a multiplex node, and simultaneously connecting a saturrate node to the multiplex node, thereby implementing, by the multiplex node, multiplication processing on the failure Color map and a differential texture map generated after processing the saturrate node, and obtaining a Color texture map.
Referring to fig. 6, a flowchart illustrating steps of another method for processing graphics in a game according to an embodiment of the present invention is shown, where the method specifically includes the following steps:
step 601, setting different UV offset values for the initial texture map, and performing UV offset on the initial texture map according to the different UV offset values respectively to obtain a plurality of distorted texture maps.
Step 602, performing subtraction processing on the initial texture map and the plurality of distorted texture maps respectively to obtain a plurality of difference texture maps;
after the plurality of warped texture maps are generated, the warped texture maps and the initial texture map may be subtracted to obtain a plurality of difference texture maps, wherein each warped texture map may generate a corresponding difference texture map. In a specific implementation, each distorted texture map is connected to a substact node, and an initial texture map is connected to the substact node, so that a plurality of corresponding difference texture maps can be obtained by subtraction processing of the substact node.
Step 603, respectively performing color adjustment on the multiple difference texture maps to obtain multiple color texture maps;
in a specific implementation, color values of the respective differential texture maps are mapped between 0 and 1, for example, in a shader of Unity, the respective differential texture maps may be connected to the saturrate node, so as to implement color adjustment on the respective differential texture maps. Furthermore, each difference texture map is colored by using a preset color value to obtain a color texture map, where the preset color values may be different when each difference texture map is colored, and the preset color values corresponding to each difference texture map may also be set as required, which is not limited in the embodiment of the present invention.
Step 604, overlapping the color texture maps and the distorted texture maps to obtain target texture maps;
in the embodiment of the present invention, each color texture map and each distorted texture map may be respectively subjected to an overlay process to obtain a plurality of corresponding target texture maps.
Step 605, rendering the plurality of target texture maps in the game respectively at different times to present a failure distortion animation effect.
And rendering a plurality of target texture maps in the game at different moments respectively to present a fault distortion animation effect in the game scene.
In order to enable those skilled in the art to better understand the above steps, the following description is provided for the embodiment of the present invention with reference to fig. 7, but it should be understood that the embodiment of the present invention is not limited thereto.
Specifically, in the shader of Unity, the initial texture map is first warped to obtain a warped texture map, and then the warped texture map and the initial texture map are connected to a substact node to perform subtraction processing on the two maps.
After the Substract node is connected, the Substract node is further connected to a Saturate node, and the color value of the differential texture map obtained through Substract processing is mapped between 0 and 1 through the Saturate node, so that the color purity of the differential texture map is increased. And setting a fault effect Color through the Glitch Color node, and connecting the Saturate node and the Glitch Color node to a multiplex node to realize coloring the differential texture mapping to obtain a Color texture mapping. And finally, connecting a multiplex node into the Add node, and connecting the distorted texture map into the Add node, so that the color texture map and the distorted texture map are superposed to obtain a target texture map, and the target texture map can be rendered in a game scene to present a fault distortion effect.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 8, a block diagram of a graphics processing apparatus in a game according to an embodiment of the present invention is shown, where the apparatus may specifically include the following modules:
a warping processing module 801, configured to warp an initial texture map in the game to obtain a warped texture map;
a subtraction processing module 802, configured to perform subtraction processing on the initial texture map and the warped texture map to obtain a difference texture map;
a color adjusting module 803, configured to perform color adjustment according to the difference texture map to obtain a color texture map;
a superposition processing module 804, configured to perform superposition processing on the color texture map and the warped texture map to obtain a target texture map.
In a preferred embodiment of the present invention, the warped texture map includes a plurality of pieces, and the warping processing module 801 includes:
and the UV offset submodule is used for setting different UV offset values for the initial texture mapping, and performing UV offset on the initial texture mapping according to the different UV offset values respectively so as to obtain a plurality of distorted texture mappings.
In a preferred embodiment of the present invention, the method further comprises:
the distorted texture mapping processing module is used for processing the distorted texture mapping to obtain a plurality of corresponding target texture mapping;
and the target texture mapping rendering module is used for rendering the plurality of target texture mappings in the game respectively at different times so as to present a fault distortion animation effect.
In a preferred embodiment of the present invention, the subtraction processing module 802 includes:
and the subtraction processing submodule is used for subtracting the color values of the preset channels of the distorted texture map and the initial texture map to obtain a difference texture map.
In a preferred embodiment of the present invention, the color adjusting module 803 includes:
a color value mapping submodule for mapping the color value of the differential texture map between 0 and 1;
and the difference texture mapping coloring sub-module is used for coloring the difference texture mapping by adopting a preset color value to obtain a color texture mapping.
In a preferred embodiment of the present invention, the color value mapping sub-module includes:
a color value mapping unit for mapping the color value of the difference texture map to between 0 and 1 by a Saturate function.
In a preferred embodiment of the present invention, the difference texture map coloring sub-module includes:
the fault color mapping generating unit is used for generating a fault color mapping according to the preset color value;
and the multiplication processing unit is used for carrying out multiplication processing on the fault color mapping and the difference value texture mapping to obtain a color texture mapping.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides an electronic device, as shown in fig. 9, including:
a processor 901, a storage medium 902 and a bus 903, wherein the storage medium 902 stores machine-readable instructions executable by the processor 901, when the electronic device is operated, the processor 901 communicates with the storage medium 902 through the bus 903, and the processor 801 executes the machine-readable instructions to perform any one of the methods according to the embodiments of the present invention. The specific implementation manner and technical effects are similar to those of the method embodiment, and are not described herein again.
An embodiment of the present invention further provides a computer-readable storage medium, as shown in fig. 10, where the storage medium stores a computer program 1001, and when the computer program 1001 is executed by a processor, the computer program 1001 executes a method according to any one of the embodiments of the present invention. The specific implementation manner and technical effects are similar to those of the method embodiment, and are not described herein again.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The present invention provides a method and a device for processing graphics in a game, which are described in detail above, and the principle and the implementation of the present invention are explained herein by applying specific examples, and the description of the above examples is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for graphics processing in a game, comprising:
twisting an initial texture map in the game to obtain a twisted texture map;
subtracting the initial texture map and the distorted texture map to obtain a difference texture map;
carrying out color adjustment on the difference texture mapping to obtain a color texture mapping;
and overlapping the color texture mapping and the distorted texture mapping to obtain a target texture mapping.
2. The method of claim 1, wherein the warped texture map comprises a plurality of warped texture maps, and wherein warping an initial texture map in the game to obtain the warped texture map comprises:
and setting different UV offset values for the initial texture mapping, and performing UV offset on the initial texture mapping according to the different UV offset values respectively to obtain a plurality of distorted texture mappings.
3. The method of claim 2, further comprising:
processing the plurality of distorted texture maps respectively to obtain a plurality of corresponding target texture maps;
and at different times, rendering the multiple target texture maps in the game respectively to present a fault distortion animation effect.
4. The method of claim 1, wherein subtracting the initial texture map and the warped texture map to obtain a difference texture map comprises:
and subtracting the color values of the preset channels of the distorted texture map and the initial texture map to obtain a difference texture map.
5. The method of claim 1, wherein the performing color adjustment according to the difference texture map to obtain a color texture map comprises:
mapping color values of the difference texture map to between 0 and 1;
and coloring the difference texture mapping by adopting a preset color value to obtain a color texture mapping.
6. The method of claim 5, wherein mapping the color values of the difference texture map to between 0 and 1 comprises:
the color values of the difference texture map are mapped between 0 and 1 by the saturrate function.
7. The method of claim 5, wherein coloring the difference texture map with a predetermined color value to obtain a color texture map comprises:
generating a fault color map according to the preset color value;
and multiplying the fault color mapping and the difference value texture mapping to obtain a color texture mapping.
8. An in-game graphics processing apparatus, comprising:
the distortion processing module is used for carrying out distortion processing on an initial texture map in the game to obtain a distorted texture map;
a subtraction processing module, configured to perform subtraction processing on the initial texture map and the warped texture map to obtain a difference texture map;
the color adjusting module is used for adjusting colors according to the difference texture mapping to obtain a color texture mapping;
and the superposition processing module is used for carrying out superposition processing on the color texture mapping and the distorted texture mapping to obtain a target texture mapping.
9. An electronic device, comprising:
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 method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202110470301.0A 2021-04-28 2021-04-28 Graphic processing method and device in game Active CN113181639B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110470301.0A CN113181639B (en) 2021-04-28 2021-04-28 Graphic processing method and device in game

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110470301.0A CN113181639B (en) 2021-04-28 2021-04-28 Graphic processing method and device in game

Publications (2)

Publication Number Publication Date
CN113181639A true CN113181639A (en) 2021-07-30
CN113181639B CN113181639B (en) 2024-06-04

Family

ID=76980462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110470301.0A Active CN113181639B (en) 2021-04-28 2021-04-28 Graphic processing method and device in game

Country Status (1)

Country Link
CN (1) CN113181639B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117095108A (en) * 2023-10-17 2023-11-21 海马云(天津)信息技术有限公司 Texture rendering method and device for virtual digital person, cloud server and storage medium
CN117456077A (en) * 2023-10-30 2024-01-26 神力视界(深圳)文化科技有限公司 Material map generation method and related equipment

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050111718A1 (en) * 2003-11-26 2005-05-26 University Of Chicago Automated method and system for the evaluation of disease and registration accuracy in the subtraction of temporally sequential medical images
CN105117727A (en) * 2015-09-18 2015-12-02 浙江工业大学 Method for fast positioning license plate
CN105631924A (en) * 2015-12-28 2016-06-01 北京像素软件科技股份有限公司 Method for implementing distortion effect in scene
CN107564085A (en) * 2017-10-24 2018-01-09 北京奇虎科技有限公司 Scalloping processing method, device, computing device and computer-readable storage medium
CN108876931A (en) * 2017-05-12 2018-11-23 腾讯科技(深圳)有限公司 Three-dimension object color adjustment method, device, computer equipment and computer readable storage medium
CN110084735A (en) * 2019-04-26 2019-08-02 新华三云计算技术有限公司 Watermark adding method, analytic method, device, electronic equipment and storage medium
CN111097169A (en) * 2019-12-25 2020-05-05 上海米哈游天命科技有限公司 Game image processing method, device, equipment and storage medium
CN111311719A (en) * 2020-02-10 2020-06-19 网易(杭州)网络有限公司 Display processing method and device in game
CN111968213A (en) * 2020-10-23 2020-11-20 成都完美时空网络技术有限公司 Warping effect generation method, device, equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050111718A1 (en) * 2003-11-26 2005-05-26 University Of Chicago Automated method and system for the evaluation of disease and registration accuracy in the subtraction of temporally sequential medical images
CN105117727A (en) * 2015-09-18 2015-12-02 浙江工业大学 Method for fast positioning license plate
CN105631924A (en) * 2015-12-28 2016-06-01 北京像素软件科技股份有限公司 Method for implementing distortion effect in scene
CN108876931A (en) * 2017-05-12 2018-11-23 腾讯科技(深圳)有限公司 Three-dimension object color adjustment method, device, computer equipment and computer readable storage medium
CN107564085A (en) * 2017-10-24 2018-01-09 北京奇虎科技有限公司 Scalloping processing method, device, computing device and computer-readable storage medium
CN110084735A (en) * 2019-04-26 2019-08-02 新华三云计算技术有限公司 Watermark adding method, analytic method, device, electronic equipment and storage medium
CN111097169A (en) * 2019-12-25 2020-05-05 上海米哈游天命科技有限公司 Game image processing method, device, equipment and storage medium
CN111311719A (en) * 2020-02-10 2020-06-19 网易(杭州)网络有限公司 Display processing method and device in game
CN111968213A (en) * 2020-10-23 2020-11-20 成都完美时空网络技术有限公司 Warping effect generation method, device, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117095108A (en) * 2023-10-17 2023-11-21 海马云(天津)信息技术有限公司 Texture rendering method and device for virtual digital person, cloud server and storage medium
CN117095108B (en) * 2023-10-17 2024-01-23 海马云(天津)信息技术有限公司 Texture rendering method and device for virtual digital person, cloud server and storage medium
CN117456077A (en) * 2023-10-30 2024-01-26 神力视界(深圳)文化科技有限公司 Material map generation method and related equipment

Also Published As

Publication number Publication date
CN113181639B (en) 2024-06-04

Similar Documents

Publication Publication Date Title
US10902663B2 (en) Method and apparatus for displaying 2D application interface in virtual reality device
CN102254340B (en) Method and system for drawing ambient occlusion images based on GPU (graphic processing unit) acceleration
TWI244050B (en) Recirculating shade tree blender for a graphics system
CN111161392B (en) Video generation method and device and computer system
US8351689B2 (en) Apparatus and method for removing ink lines and segmentation of color regions of a 2-D image for converting 2-D images into stereoscopic 3-D images
CN113181639B (en) Graphic processing method and device in game
WO2021135320A1 (en) Video generation method and apparatus, and computer system
CN112316420A (en) Model rendering method, device, equipment and storage medium
CN113436343B (en) Picture generation method and device for virtual concert hall, medium and electronic equipment
CN111402373B (en) Image processing method and device, electronic equipment and storage medium
CN102819855B (en) The generation method of two dimensional image and device
CN110866967B (en) Water ripple rendering method, device, equipment and storage medium
CN111583378A (en) Virtual asset processing method and device, electronic equipment and storage medium
CN114820834A (en) Effect processing method, device, equipment and storage medium
WO2015052514A2 (en) Rendering composites/layers for video animations
US9872005B2 (en) Moving image reproducing apparatus
CN113192173B (en) Image processing method and device of three-dimensional scene and electronic equipment
CN114191815A (en) Display control method and device in game
CN114565686A (en) Video processing method and device, electronic equipment and readable storage medium
CN114693894A (en) Method, system and device for converting pictures into building blocks in virtual world
JP2010231347A (en) Method and apparatus for image generation
EP4070538A1 (en) Encoding stereo splash screen in static image
US10225655B1 (en) Stereo user interface elements placed in 3D space for virtual reality applications in head mounted displays
CN113676753B (en) Method and device for displaying video in VR scene, electronic equipment and storage medium
CN111231826A (en) Control method, device and system for vehicle model steering lamp in panoramic image and storage medium

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