CN107657648A - The colouring method and system of real-time high-efficiency in a kind of moving game - Google Patents

The colouring method and system of real-time high-efficiency in a kind of moving game Download PDF

Info

Publication number
CN107657648A
CN107657648A CN201710922696.7A CN201710922696A CN107657648A CN 107657648 A CN107657648 A CN 107657648A CN 201710922696 A CN201710922696 A CN 201710922696A CN 107657648 A CN107657648 A CN 107657648A
Authority
CN
China
Prior art keywords
character image
texture
color
lookup table
rgb
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
CN201710922696.7A
Other languages
Chinese (zh)
Other versions
CN107657648B (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.)
Guangzhou Yue World Mdt Infotech Ltd
Original Assignee
Guangzhou Yue World Mdt Infotech 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 Guangzhou Yue World Mdt Infotech Ltd filed Critical Guangzhou Yue World Mdt Infotech Ltd
Priority to CN201710922696.7A priority Critical patent/CN107657648B/en
Publication of CN107657648A publication Critical patent/CN107657648A/en
Application granted granted Critical
Publication of CN107657648B publication Critical patent/CN107657648B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • 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
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a kind of colouring method of real-time high-efficiency in moving game, methods described includes:Receiving needs to do the character image dyed;The color lookup table of the character image is obtained, exports the cube cube formatted files of the character image;The color lookup table is handled, generates and store the video memory texture being adapted with terminal;Color is changed in piece member session map according to the cube cubes formatted file, then carries out dyeing processing to complete the dyeing of character image.The present invention by obtaining and handling the color lookup table of character image completes the dyeing course of character image, can not only real-time high-efficiency and height reduce design sketch Jing Guo complex process, and expense is smaller, consumes energy relatively low.

Description

The colouring method and system of real-time high-efficiency in a kind of moving game
Technical field
The present invention relates to game Rendering field, more particularly in a kind of moving game the colouring method of real-time high-efficiency and System.
Background technology
With the great-leap-forward development of electronic game and online game on all kinds of platforms, instantly, either mobile phone etc. moves Dynamic terminal game or the game of traditional PC ends, the setting of game role have become the important of a ripe electronic game Function, the game that the function greatly improves player substitute into sense.
In gaming, the role to control game, which changes the outfit, to be mainly shown as to the personal settings of game role, and these Beautiful in colour, colourful clothes need complicated dyeing processing.However, existing 2D game is using regulation pixel in real time HSL realizes that character image fashionable dress dyes, i.e. three the integrally-regulated picture tone of art designing, saturation degree, brightness parameters, then in GPU It is middle that line translation is entered to original image to realize the bulk dyeing to game role image according to these three parameters, it is virtual in order to realize The display effect of reality, integrally-regulated image HSL realize that the method dyed in real time uses Photoshop to art designing in gaming The limitation of colour switching processing means is very big, it is impossible to local differentiation is handled, effect out is not abundant enough;Another aspect HSL becomes Change that the complexity realized in GPU is higher, and many branches in algorithm judge not meeting GPU stream process characteristics;Therefore, have in performance The real-time dyeing of good result is realized on the mobile terminal of limit needs more costs, further increases cost, Consumer's Experience satisfaction Degree is not also high.
The content of the invention
The shortcomings that present invention is directed to existing way, the colouring method and system of real-time high-efficiency in a kind of moving game are proposed, To solve above mentioned problem existing for prior art.
According to the first aspect of the invention, there is provided the colouring method of real-time high-efficiency in a kind of moving game, including such as Lower step:
Receiving needs to do the character image dyed;
The color lookup table of the character image is obtained, exports the cube cube formatted files of the character image;
The color lookup table is handled, generates and store the video memory texture being adapted with terminal;
Color is changed in piece member session map according to the cube cubes formatted file, then carries out dyeing processing to complete The dyeing of character image.
Preferably, the color lookup table for obtaining the character image, the cube cubes of the character image are exported Formatted file, specifically include:
After the enabled instruction startup Photoshop for responding operator, Photoshop receives follow-up operational order and execution Following operation:
Figure layer is added for the character image, assigns target effect, Selective filling, export to obtain the character image RGB color look-up table;
The mesh point of input 16 × 16 × 16 simultaneously exports the cube cube formatted files of the character image.
Further, the color lookup table is handled to generate and store the video memory texture being adapted with terminal, specific bag Include:
The color lookup table is scanned to obtain dimension N,
Distribute the texture memory space of N × N × N × 3;
Detect whether the terminal supports 3D texture lookups and output result, if the terminal supports 3D texture lookups, Then using the RGB three-dimensional N scan rounds color lookup table initialization texture memory of N × N × N × 3,3D video memory textures are generated, are set Linear filters and is stored to video memory in submitting;If the terminal does not support 3D texture lookups, circulated using RGB three-dimensionals N Color lookup table is scanned, arrives BR dimensions G dimensions are open and flat, open and flat N × N × N × 3 cubes are (N × sqrt (N)) ^2 × 3 two Dimension internal memory simultaneously generates 2D video memory textures, is arranged to two-dimensional linear and filters and be stored to video memory in submitting.
Further, color is changed in piece member session map according to the cube cubes formatted file, then dyed Processing with complete the dyeing of character image, in particular to, related to the summit and the texture will be believed by data/address bus Breath passes to GPU and is handled as follows:
It is first with assembly tab to obtain the summit of the character image,
Color is changed to carry out RGB coloring treatments in piece member session map according to the cube cubes formatted file,
Insertion dyeing processing is first to obtain the piece after processing in piece member after the progress RGB coloring treatments,
Color assignment is carried out to complete to dye to the piece member after processing.
Further, after insertion dyeing processing is to obtain processing in the piece member after the progress RGB coloring treatments Piece member, refer to:Detect whether the terminal supports 3D textures and output result, if the terminal supports 3D textures, make It is that texture coordinate sampling 3D cubes search table texture with RGB;If the terminal does not support 3D textures, by three-dimensional RGB face Color switchs to two-dimentional uv coordinates, and searches table texture using two-dimentional uv coordinates sampling 2D.
On the other hand, the invention provides a kind of coloring system of real-time high-efficiency in moving game, the system includes connecing Receive module, acquisition module, processing module and staining modules:
Receiving module, need to do the character image dyed for receiving;
Acquisition module, for obtaining the color lookup table of the character image, export cube cubes of the character image Body formatted file;
Processing module, for handling the color lookup table, generate and store the video memory texture being adapted with terminal;
Staining modules, for changing color in piece member session map according to the cube cubes formatted file, then carry out Dyeing is handled to complete the dyeing of character image.
Preferably, the acquisition module specifically refers to Photoshop, and the enabled instruction of Photoshop response operators is opened After dynamic, receive follow-up operational order and perform following operation:
Figure layer is added for the character image, assigns target effect, Selective filling, export to obtain the character image RGB color look-up table;
The mesh point of input 16 × 16 × 16 simultaneously exports the cube cube formatted files of the character image.
Further, the processing module is additionally operable to,
The color lookup table is scanned to obtain dimension N;
Distribute the texture memory space of N × N × N × 3;
Detect whether the terminal supports 3D texture lookups and output result, if the terminal supports 3D texture lookups, Then using the RGB three-dimensional N scan rounds color lookup table initialization texture memory of N × N × N × 3,3D video memory textures are generated, are set Linear filters and is stored to video memory in submitting;If the terminal does not support 3D texture lookups, circulated using RGB three-dimensionals N Color lookup table is scanned, arrives BR dimensions G dimensions are open and flat, open and flat N × N × N × 3 cubes are (N × sqrt (N)) ^2 × 3 two Dimension internal memory simultaneously generates 2D video memory textures, is arranged to two-dimensional linear and filters and be stored to video memory in submitting.
Preferably, the staining modules refer to that GPU, GPU receive the summit and the line by data/address bus transmission After the relevant information of reason, it is handled as follows:
It is first with assembly tab to obtain the summit of the character image,
Color is changed to carry out RGB coloring treatments in piece member session map according to the cube cubes formatted file,
Insertion dyeing processing is first to obtain the piece after processing in piece member after the progress RGB coloring treatments,
Color assignment is carried out to complete to dye to the piece member after processing.
Further, after insertion dyeing processing is to obtain processing in the piece member after the progress RGB coloring treatments Piece member, refer to:Detect whether the terminal supports 3D textures and output result, if the terminal supports 3D textures, make It is that texture coordinate sampling 3D cubes search table texture with RGB;If the terminal does not support 3D textures, by three-dimensional RGB face Color switchs to two-dimentional uv coordinates, and searches table texture using two-dimentional uv coordinates sampling 2D.
Compared with prior art, the beneficial effects of the invention are as follows:
1st, the dyeing course of character image is completed by obtaining and handling the color lookup table of character image, can not only Real-time high-efficiency and height reduce the design sketch Jing Guo complex process, and expense is smaller, and power consumption is relatively low;
2nd, Photoshop is passed through, it is possible to achieve art designing does the post processing of complexity to image to strengthen image effect, and will not Increase game resource size, with regard to the real-time rich of 2D game pictures can be improved, further, can improve and locate in real time in mobile terminal Reason high-definition picture and the ability for applying multiple complex colors conversion on high-definition picture;
3rd, by GPU, experimenter can change image processing part split flow, and CPU just can be from the task of image procossing Free so that process is more convenient, and CPU can also carry out other more system tasks, can so greatly improve meter The overall performance of calculation machine;
4th, character image is dyed in real time with reference to Photoshop and GPU, not only compatibility is preferable, and should in game In, occupancy memory space is less, and memory consumption is relatively low.
The additional aspect of the present invention and advantage will be set forth in part in the description, and these will become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
Of the invention above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Substantially and it is readily appreciated that, wherein:
Fig. 1 be embodiment 1 a kind of moving game in real-time high-efficiency colouring method schematic flow diagram;
Fig. 2 be embodiment 2 a kind of moving game in real-time high-efficiency coloring system structured flowchart;
Fig. 3 is the flow chart for carrying out art designing to character image by Photoshop;
Fig. 4 is the flow chart of color lookup table texture loading procedure;
Fig. 5 is GPU coloration and dyeing flows;
Fig. 6 is the design sketch dyed in gaming to the wing of game role image using the embodiment of the present invention;
Fig. 7 is the design sketch dyed in gaming to the clothes of game role image using the embodiment of the present invention.
Embodiment
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described.
In some flows of description in description and claims of this specification and above-mentioned accompanying drawing, contain according to Particular order occur multiple operations, but it should be clearly understood that these operation can not occur herein according to it is suitable Sequence is performed or performed parallel, the sequence number such as 101,102 etc. of operation, is only used for distinguishing each different operation, sequence number Any execution sequence is not represented for itself.In addition, these flows can include more or less operations, and these operations can To perform or perform parallel in order.It should be noted that the description such as " first " herein, " second ", is to be used to distinguish not Message together, equipment, module etc., do not represent sequencing, it is different types also not limit " first " and " second ".
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only the embodiment of a part of example of the present invention, implementation rather than whole.It is based on Embodiment in the present invention, the every other implementation that those skilled in the art are obtained under the premise of creative work is not made Example, belongs to the scope of protection of the invention.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology art Language and scientific terminology), there is the general understanding identical meaning with the those of ordinary skill in art of the present invention.Should also Understand, those terms defined in such as general dictionary, it should be understood that have with the context of prior art The consistent meaning of meaning, and unless by specific definitions as here, idealization or the implication of overly formal otherwise will not be used To explain.
It will appreciated by the skilled person that the implication of noun involved in the present invention comprises at least:
HSL color modes are a kind of color standards of industrial quarters, are by form and aspect (H), saturation degree (S), lightness (L) three The change of individual Color Channel and their mutual superpositions obtain miscellaneous color, and HSL is to represent form and aspect, Saturation degree, the color of three passages of lightness.
GPU refers to graphics processor, and it is a kind of title of video card processor, and it is video card " heart ", similar with CPU, Only GPU is to aim to perform complicated mathematics and geometry calculating and design, and these calculating are necessary to figure renders.
Photoshop, referred to as " PS " is the image processing software developed and issued by Adobe Systems, main processing The digital picture formed with pixel.Using its it is numerous compile and drawing instrument, can effectively carry out picture editor's work. Functionally see, Photoshop can be divided into picture editting, image synthesis, color correction toning and function Se Xiao preparing department and grade.Figure Picture editor is the basis of image procossing, and various conversion such as amplification, diminution, rotation, inclination, mirror image, perspectives can be done to image; Also may be copied, remove spot, repairing, decorative image it is damaged etc..Image synthesis is then to grasp a few width images by figure layer Make and instrument application synthesis is complete, passes on the image of its meaning, this is the only way which must be passed of artistic design;What the software provided Drawing instrument allows external image to be merged well with intention.Color correction toning conveniently and efficiently the color of image can be carried out light and shade, The adjustment and correction of colour cast, it can also be switched in different colours to meet image in different field such as webpage design, printing, more Media etc. are applied.Special effect making is mainly completed in the software by filter, passage and instrument integrated application.Including image The conventional Traditional Fine Arts skill of the making of special efficacy intention and special efficacy word, such as oil painting, embossment, gypsum picture, sketch all can be by this Software special efficacy is completed.
When realizing the method dyed in real time in gaming, because HSL must be converted by RGB, therefore, existing use When Photoshop handles image, HSL colors must be converted into by the original RGB colors of image, and exist during the integrally-regulated image HSL of event Effect it is limited, performance consumption is too high and evades mobile device supports limited three problems to three-dimensional cubic volume textures.
3D engines Cryengine and unreal3 can using 3D look-up tables come to game screen hue adjustment support, still 3D cubes of volume textures are supported limited in mobile terminal, it is impossible to directly use 2D game colorings.
Therefore, in order to solve the above problems, there is provided the colouring method and system of real-time high-efficiency in a kind of moving game.
Embodiment one
As shown in Figure 1, there is provided the colouring method of real-time high-efficiency in a kind of moving game of one embodiment of the invention, should Method includes step S101-S104:
S101, which is received, to be needed to do the character image dyed;
S102 obtains the color lookup table of the character image, exports the cube cubes form text of the character image Part;
Preferably, as shown in figure 3, present inventor performs step S101-S102 using Photoshop, specifically such as Under
After the enabled instruction startup Photoshop for responding operator, receive follow-up operational order and perform following operation:
S301 is opened using photoshop to be needed to do the character image dyed;
S302 is that the character image adds figure layer, assigns target effect;
S303 Selective fillings, export to obtain the RGB color look-up table of the character image;
S304 inputs 16 × 16 × 16 mesh point
S305 exports the cube cube formatted files of the character image.
In PS be can on image using various complicated conversion to assign image effect, then export 16 × 16 × 16 color lookup mapping tables, to export the cube cube formatted files of the character image.
RGB color look-up table is the look-up table of RGB triple channels, and inclusion size is used with internal memory in reality game application It is all restricted.One 32 × 32 × 32 look-up table needs 393KB, and the look-up table of one 256 × 256 × 256 needs 200MB, warp Repeatedly debugging is crossed, the look-up table of the present embodiment selection reduced size 16 × 16 × 16 is taken into account simultaneously to realize the interpolation of high quality The advantages of good display effect of figure and few EMS memory occupation.
The S103 processing color lookup table, generates and stores the video memory texture being adapted with terminal, specifically, such as Fig. 4 It is shown:
S401 scans the color lookup table to obtain dimension N,
S402 distribution N × N × N × 3 texture memory spaces,
S403 detects whether the terminal supports 3D texture lookups and output result,
If the S404 terminals support 3D texture lookups, initialized using RGB three-dimensional N scan rounds color lookup table The texture memory of N × N × N × 3,3D video memory textures are generated, set linear to filter;
If the terminal does not support 3D texture lookups, using RGB three-dimensional N scan round color lookup tables, G dimensions Open and flat to arrive BR dimensions, N × N × N × 3 cubes are open and flat for the 2 d texture internal memory of (N × sqrt (N)) ^2 × 3, generate 2D video memory lines Reason, it is arranged to two-dimensional linear filtering;
S405 submits texture memory in step S404 to video memory.
Those skilled in the art is understood, internal memory can be saved using the color lookup table compared with low dimensional;To three-dimensional data Collection, which carries out linear search, to be needed to use linear interpolation along each axle in 3 axles, by 8 angles of a cube Weighted value averagely generate, simple cube interpolation need 3^3=27 times lookup.Because realizing that expense is higher in CPU, part Mobile device GPU can provide hardware-accelerated three-D grain interpolation lookup.
In the equipment for not supporting 3D textures, 3D textures it is open and flat be 2D textures.
Mapping equation on internal memory is v=b+ (g%4) × 16;U=r+g/4 × 16.
Dimension becomes N × sqrt (N).I.e. g, low 4 are encoded to the high 4 of v, and the high by 4 of u is encoded to high 4 of g Position.
S104 according to the cube cubes formatted file piece member session map change color, then carry out dyeing processing with Complete the dyeing of character image.
Specifically, as shown in figure 5, the relevant information with the summit and the texture is passed to by data/address bus GPU is simultaneously handled as follows:
S501 summits calculate,
Specifically refer to, the summit of the character image and the attribute on the summit are obtained, further according to the category on the summit Property assembling pel, then by the pel assemble in flakes member.
S502 pieces member coloring RGB,
Specifically refer to, color is changed in piece member session map according to the cube cubes formatted file, mainly carried out RGB coloring treatments.
The member coloring insertion dyeing processing of S503 pieces,
Specifically refer to, insertion, which is dyed, in the piece member after the progress RGB coloring treatments is handled to obtain the piece after processing Member,
S504 judges whether 3D textures,
Specifically refer to, detect whether the terminal supports 3D textures and output result, if the terminal supports 3D textures, The use of RGB is then that texture coordinate samples 3D cubes lookup table texture;
If the terminal does not support 3D textures, three-dimensional RGB color is switched into two-dimentional uv coordinates, and use two-dimentional uv Coordinate sampling 2D searches table texture.Such as:
Assuming that N=16, rgb turn uv processes
Rr=floor (rgb.r*15.0) takes r passages 0~1.0 to be amplified to 0~15
Gg=floor (rgb.g*15.0) takes g passages 0~1.0 to be amplified to 0~15
Bb=floor (rgb.b*15.0) takes b passages 0~1.0 to be amplified to 0~15
Gmod=mod (gg, 4.0) takes g passage low levels
Gint=floor (gg*0.25) takes g passages high-order
Uu=rr+gint*16.0 codings g is high-order high 4 to u coordinates, and r is low 4
Vv=bb+gmod*16.0 coding g low levels are high-order to v coordinate, and b is low 4
Dimension becomes 16*4=64
U=uu*1.0/64.0u coordinates divided by 64 specifications are to 0~1
V=vv*1.0/64.0v coordinates divided by 64 specifications are to 0~1
S505 assignment piece member, dyeing are completed,
Specifically refer to, color assignment is carried out to complete to dye to the piece member after processing.
The present embodiment using GPU programmable rendering pipeline (OpenGLES 2.0), OpenGLES 2.0 provide Programmable pipeline vertex program and fragment program so that process is freer.
Graphics pipeline flow is:
Vertex shader (vertexShader)->Pel assembling (Primitive Assembly)->Rasterisation (Rasterization)->Piece member tinter (FragmentShader)->Piece atom operation stage (Per-Fragment one by one Operations)。
Vertex shader
Groundwork is exactly " conversion three-dimensional vertices coordinate " and " illumination calculation ".It is responsible for apex coordinate conversion, illumination, sanction Cut, project and screen map, the stage is based on GPU and carries out computing.
Pel assembles
Apex coordinate composition line after conversion, piece member, outside screen cut.
Rasterisation
Color value and depth value are saved in pixel buffer corresponding to each pixel in calculating piece member.Here will use The application program stage calculates the texture information for producing and being stored in Texture buffer.
The step of rasterization stage:Piece member, coordinate->Back side rejecting->Alpha tests->Template test->Depth test-> Fusion treatment->Dithering process->Logical operation->Pixel frame buffer
Piece member tinter
Piece member tinter (Fragment Shader) is the programmable unit for handling the first value of piece and its related data, Function is performs the sampling of texture, the collecting of color, calculates the operation such as mist color, and every member execution is once.
The piece atom operation stage one by one
Mainly to some tests of all members, such as:Pixel ownership, shearing (glScissor), Alpha (glAlphaFunc), stencil test (glStencilFunc), depth test (glDephtFunc), mixing (glBlendFunc), these operations will finally influence its color value in frame buffer zone.
GPU is to show card " brain ", and GPU determines the class of the video card and most of performance, while GPU is also that 2D shows Show the differentiation criterion of card and 3D display hardware.2D display chips rely primarily on CPU disposal ability when handling 3D rendering and special efficacy, Referred to as soft acceleration.3D display chip is that 3-D view and special effect processing function are concentrated in display chip, that is, so-called " hardware-accelerated " function.Display chip is usually to show the upper maximum chip (and pin is most) of card.GPU no longer offices Be limited to 3D graphics process, it is a large amount of the fact also demonstrate that GPU in terms of the part calculating such as floating-point operation, parallel computation, GPU can be with Decades of times or even up to a hundred times of CPU performance are provided.Therefore, these flows are handled using GPU, CPU is just from graphics process Freed in task so that process is more convenient, and CPU can also carry out other more system tasks, so can be significantly Improve the overall performance of computer.
The present embodiment is applied to effect such as Fig. 6 and Fig. 7 in game.
Fig. 6 is the design sketch that is dyed in gaming to the wing of game role using the embodiment of the present invention, wing face Color is followed successively by red, green, yellow, and picture has used ETC compressions, and definition has loss, but experiment shows that the embodiment can be in all peaces Accelerate decoding using GPU in tall and erect equipment, reach the effect for reducing video memory;Fig. 7 is in gaming to trip using the embodiment of the present invention The design sketch that the clothes of play role is dyed, clothes color is followed successively by green, yellow, purple.From Fig. 6 and Fig. 7 design sketch, sheet The high-definition picture that embodiment is handled in real time, the color validity of Local treatment is very high, and rendering effect is preferable, further lifting Picture it is rich.
Character image is dyed in real time with reference to Photoshop and GPU, not only compatibility is preferable, and in game application In, occupancy memory space is less, and memory consumption is relatively low.
Embodiment two
As shown in Figure 2, there is provided the coloring system of real-time high-efficiency in a kind of moving game of another embodiment of the present invention, The system includes the receiving module of modules A 201, A202 acquisition modules, A203 processing modules, A204 staining modules:
A201 receiving modules, need to do the character image dyed for receiving;
A202 acquisition modules, for obtaining the color lookup table of the character image, export the cube of the character image Cube formatted file;
Preferably, the acquisition module specifically refers to Photoshop, and the enabled instruction of Photoshop response operators is opened After dynamic, receive follow-up operational order and perform following operation:
Being opened using Photoshop needs to do the character image dyed;
Figure layer is added for the character image, assigns target effect, Selective filling, export to obtain the character image RGB color look-up table;
The mesh point of input 16 × 16 × 16 simultaneously exports the cube cube formatted files of the character image.
A203 processing modules, for handling the color lookup table, generate and store the video memory texture being adapted with terminal;
Further, the processing module is additionally operable to:
The color lookup table is scanned to obtain dimension N;
Distribute the texture memory space of N × N × N × 3;
Detect whether the terminal supports 3D texture lookups and output result, if the terminal supports 3D texture lookups, Then using the RGB three-dimensional N scan rounds color lookup table initialization texture memory of N × N × N × 3,3D video memory textures are generated, are set Linear filters and is stored to video memory in submitting;If the terminal does not support 3D texture lookups, circulated using RGB three-dimensionals N Color lookup table is scanned, arrives BR dimensions G dimensions are open and flat, open and flat N × N × N × 3 cubes are (N × sqrt (N)) ^2 × 3 two Texture memory is tieed up, generates 2D video memory textures, two-dimensional linear filtering is arranged to, video memory is stored in submission.
A204 staining modules, for changing color in piece member session map according to the cube cubes formatted file, then Dyeing processing is carried out to complete the dyeing of character image.
Further, the staining modules refer to GPU, and GPU is received by the summit of data/address bus transmission and described After the relevant information of texture, it is handled as follows:
It is first with assembly tab to obtain the summit of the character image,
Color is changed to carry out RGB coloring treatments in piece member session map according to the cube cubes formatted file,
Insertion dyeing processing is first to obtain the piece after processing in piece member after the progress RGB coloring treatments,
Color assignment is carried out to complete to dye to the piece member after processing.
Further, after insertion dyeing processing is to obtain processing in the piece member after the progress RGB coloring treatments Piece member, refer to:Detect whether the terminal supports 3D textures and output result, if the terminal supports 3D textures, make It is that texture coordinate sampling 3D cubes search table texture with RGB;If the terminal does not support 3D textures, by three-dimensional RGB face Color switchs to two-dimentional uv coordinates, and searches table texture using two-dimentional uv coordinates sampling 2D.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of module and related work unit, the corresponding process in preceding method embodiment is may be referred to, herein no longer Repeat.
In 2 embodiments provided herein, it should be understood that disclosed method and system, device and, can be with Realize by another way.For example, embodiment of the method described above is only schematical, for example, the module Division, only a kind of division of logic function, can there is other dividing mode, such as multiple module or components when actually realizing Another system can be combined or be desirably integrated into, or some features can be ignored, or do not perform.It is described to be used as separating component The unit of explanation can be or may not be physically separate, can be as the part that unit is shown or can also It is not physical location, you can with positioned at a place, or can also be distributed on multiple NEs.Can be according to reality Need to select some or all of unit therein to realize the purpose of this embodiment scheme.
Described above is only some embodiments of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (10)

1. the colouring method of real-time high-efficiency in a kind of moving game, it is characterised in that comprise the following steps:
Receiving needs to do the character image dyed;
The color lookup table of the character image is obtained, exports the cube cube formatted files of the character image;
The color lookup table is handled, generates and store the video memory texture being adapted with terminal;
Color is changed in piece member session map according to the cube cubes formatted file, then carries out dyeing processing to complete role The dyeing of image.
2. according to the method for claim 1, it is characterised in that the color lookup table for obtaining the character image, lead Go out the cube cube formatted files of the character image, specifically include:
After the enabled instruction startup Photoshop for responding operator, Photoshop receives follow-up operational order, and simultaneously execution is as follows Operation:
Figure layer is added for the character image, assigns target effect, Selective filling, export to obtain the RGB of the character image Color lookup table;
The mesh point of input 16 × 16 × 16 simultaneously exports the cube cube formatted files of the character image.
3. according to the method for claim 1, it is characterised in that the processing color lookup table with generate and store with The adaptable video memory texture of terminal, is specifically included:
The color lookup table is scanned to obtain dimension N,
Distribute the texture memory space of N × N × N × 3;
Detect whether the terminal supports 3D texture lookups and output result, if the terminal supports 3D texture lookups, make With the RGB three-dimensional N scan rounds color lookup table initialization texture memory of N × N × N × 3,3D video memory textures are generated, are set three-dimensional Video memory is stored in lf and submission;If the terminal does not support 3D texture lookups, RGB three-dimensional N scan rounds are used Color lookup table, BR dimensions is arrived G dimensions are open and flat, open and flat N × N × N × 3 cubes are (N × sqrt (N)) two-dimentional line in ^2 × 3 Reason internal memory simultaneously generates 2D video memory textures, is arranged to two-dimensional linear and filters and be stored to video memory in submitting.
4. according to the method for claim 1, it is characterised in that described first in piece according to the cube cubes formatted file Session map changes color, then carry out dyeing processing with complete the dyeing of character image, in particular to, will be with by data/address bus The relevant information of the summit and the texture passes to GPU and is handled as follows:
It is first with assembly tab to obtain the summit of the character image,
Color is changed to carry out RGB coloring treatments in piece member session map according to the cube cubes formatted file,
Insertion dyeing processing is first to obtain the piece after processing in piece member after the progress RGB coloring treatments,
Color assignment is carried out to complete to dye to the piece member after processing.
5. according to the method for claim 4, it is characterised in that in the piece member after the progress RGB coloring treatments Insertion dyeing processing is referred to obtaining the piece member after processing:Detect whether the terminal supports 3D textures and output result, if The terminal supports 3D textures, then the use of RGB is that texture coordinate samples 3D cubes lookup table texture;If the terminal is not propped up 3D textures are held, then three-dimensional RGB color are switched into two-dimentional uv coordinates, and table texture is searched using two-dimentional uv coordinates sampling 2D.
A kind of 6. coloring system of real-time high-efficiency in moving game, it is characterised in that including:
Receiving module, need to do the character image dyed for receiving;
Acquisition module, for obtaining the color lookup table of the character image, export cube cubes of physique of the character image Formula file;
Processing module, for handling the color lookup table, generate and store the video memory texture being adapted with terminal;
Staining modules, for changing color in piece member session map according to the cube cubes formatted file, then dyed Handle to complete the dyeing of character image.
7. system according to claim 6, it is characterised in that the acquisition module specifically refers to Photoshop, After the enabled instruction of Photoshop response operators starts, receive follow-up operational order and perform following operation:
Figure layer is added for the character image, assigns target effect, Selective filling, export to obtain the RGB of the character image Color lookup table;
The mesh point of input 16 × 16 × 16 simultaneously exports the cube cube formatted files of the character image.
8. system according to claim 6, it is characterised in that the processing module is additionally operable to,
The color lookup table is scanned to obtain dimension N,
Distribute the texture memory space of N × N × N × 3;
Detect whether the terminal supports 3D texture lookups and output result, if the terminal supports 3D texture lookups, make With the RGB three-dimensional N scan rounds color lookup table initialization texture memory of N × N × N × 3,3D video memory textures are generated, are set three-dimensional Video memory is stored in lf and submission;If the terminal does not support 3D texture lookups, RGB three-dimensional N scan rounds are used Color lookup table, BR dimensions are arrived G dimensions are open and flat, N × N × N × 3 cubes are open and flat in the two dimension of (N × sqrt (N)) ^2 × 3 Deposit and generate 2D video memory textures, be arranged to two-dimensional linear and filter and be stored to video memory in submitting.
9. system according to claim 6, it is characterised in that the staining modules refer to that GPU, GPU are received and pass through data Behind the summit of bus transmission and the relevant information of the texture, it is handled as follows:
It is first with assembly tab to obtain the summit of the character image,
Color is changed to carry out RGB coloring treatments in piece member session map according to the cube cubes formatted file,
Insertion dyeing processing is first to obtain the piece after processing in piece member after the progress RGB coloring treatments,
Color assignment is carried out to complete to dye to the piece member after processing.
10. system according to claim 9, it is characterised in that in the piece member after the progress RGB coloring treatments Insertion dyeing processing is referred to obtaining the piece member after processing:Detect whether the terminal supports 3D textures and output result, if The terminal supports 3D textures, then the use of RGB is that texture coordinate samples 3D cubes lookup table texture;If the terminal is not propped up 3D textures are held, then three-dimensional RGB color are switched into two-dimentional uv coordinates, and table texture is searched using two-dimentional uv coordinates sampling 2D.
CN201710922696.7A 2017-09-30 2017-09-30 Real-time efficient dyeing method and system in mobile game Active CN107657648B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710922696.7A CN107657648B (en) 2017-09-30 2017-09-30 Real-time efficient dyeing method and system in mobile game

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710922696.7A CN107657648B (en) 2017-09-30 2017-09-30 Real-time efficient dyeing method and system in mobile game

Publications (2)

Publication Number Publication Date
CN107657648A true CN107657648A (en) 2018-02-02
CN107657648B CN107657648B (en) 2021-05-04

Family

ID=61117587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710922696.7A Active CN107657648B (en) 2017-09-30 2017-09-30 Real-time efficient dyeing method and system in mobile game

Country Status (1)

Country Link
CN (1) CN107657648B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108519865A (en) * 2018-03-09 2018-09-11 福州瑞芯微电子股份有限公司 Source switches display methods, storage medium and system
CN110473282A (en) * 2019-08-22 2019-11-19 腾讯科技(深圳)有限公司 Dyeing treatment, device, computer equipment and the storage medium of object model
CN110969676A (en) * 2019-12-23 2020-04-07 无锡幻世界软件科技有限公司 Method for quickly forming role design of hand-trip oil painting
CN112419470A (en) * 2020-12-15 2021-02-26 北京映客芝士网络科技有限公司 Color rendering method, device, equipment and medium for target area
CN115082356A (en) * 2022-07-20 2022-09-20 北京智汇云舟科技有限公司 Method, device and equipment for correcting video stream image based on shader
CN117670642A (en) * 2022-09-07 2024-03-08 象帝先计算技术(重庆)有限公司 Image rendering method, graphics processor, graphics processing system, device and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3468887B2 (en) * 1994-11-17 2003-11-17 株式会社ソニー・コンピュータエンタテインメント Image creation method and image creation device
CN101795410A (en) * 2010-03-04 2010-08-04 上海亚图软件有限公司 Texture compression and synthesis method with fine granularity and high compression rate
CN101814193A (en) * 2010-03-09 2010-08-25 哈尔滨工业大学 Real-time volume rendering method of three-dimensional heart data based on GPU (Graphic Processing Unit) acceleration
CN102903141A (en) * 2012-08-31 2013-01-30 电子科技大学 Multi-earthquake-attribution-fused texture mapping body drawing method based on nontransparency weighing
CN103186919A (en) * 2011-12-28 2013-07-03 腾讯科技(深圳)有限公司 Method and device for rendering characters

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3468887B2 (en) * 1994-11-17 2003-11-17 株式会社ソニー・コンピュータエンタテインメント Image creation method and image creation device
CN101795410A (en) * 2010-03-04 2010-08-04 上海亚图软件有限公司 Texture compression and synthesis method with fine granularity and high compression rate
CN101814193A (en) * 2010-03-09 2010-08-25 哈尔滨工业大学 Real-time volume rendering method of three-dimensional heart data based on GPU (Graphic Processing Unit) acceleration
CN103186919A (en) * 2011-12-28 2013-07-03 腾讯科技(深圳)有限公司 Method and device for rendering characters
CN102903141A (en) * 2012-08-31 2013-01-30 电子科技大学 Multi-earthquake-attribution-fused texture mapping body drawing method based on nontransparency weighing

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
PASCUAL ABELLA´N 等: ""Multimodal volume rendering with 3D textures"", 《COMPUTERS & GRAPHICS》 *
SILO: ""导出颜色查找表"", 《资源库》 *
张帆: "《Unity3D游戏开发基础》", 31 August 2013, 杭州:浙江工商大学出版社 *
李于剑: "《Visual C++实践与提高 图形图像编程篇》", 28 February 2001, 北京:中国铁道出版社 *
李娟: ""基于三维纹理映射的地震数据可视化及立体显示方法的研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑(月刊)》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108519865A (en) * 2018-03-09 2018-09-11 福州瑞芯微电子股份有限公司 Source switches display methods, storage medium and system
CN108519865B (en) * 2018-03-09 2021-04-09 瑞芯微电子股份有限公司 Source switching display method, storage medium and system
CN110473282A (en) * 2019-08-22 2019-11-19 腾讯科技(深圳)有限公司 Dyeing treatment, device, computer equipment and the storage medium of object model
CN110969676A (en) * 2019-12-23 2020-04-07 无锡幻世界软件科技有限公司 Method for quickly forming role design of hand-trip oil painting
CN110969676B (en) * 2019-12-23 2024-04-19 深圳市玛贝尔动漫文化发展有限公司 Rapid forming method for character design of hand-swimming oil painting
CN112419470A (en) * 2020-12-15 2021-02-26 北京映客芝士网络科技有限公司 Color rendering method, device, equipment and medium for target area
CN115082356A (en) * 2022-07-20 2022-09-20 北京智汇云舟科技有限公司 Method, device and equipment for correcting video stream image based on shader
CN117670642A (en) * 2022-09-07 2024-03-08 象帝先计算技术(重庆)有限公司 Image rendering method, graphics processor, graphics processing system, device and equipment

Also Published As

Publication number Publication date
CN107657648B (en) 2021-05-04

Similar Documents

Publication Publication Date Title
CN107657648A (en) The colouring method and system of real-time high-efficiency in a kind of moving game
CN108876931B (en) Three-dimensional object color adjustment method and device, computer equipment and computer readable storage medium
CN108564646A (en) Rendering intent and device, storage medium, the electronic device of object
CN109448089A (en) A kind of rendering method and device
DE3853393T2 (en) Method and device for two-dimensional image creation.
CN112316420B (en) Model rendering method, device, equipment and storage medium
US6333747B1 (en) Image synthesizing system with texture mapping
JP3678428B2 (en) Method and apparatus for chroma key, transparency, and fog operation
CN108830912A (en) A kind of interactive grayscale image color method of depth characteristic confrontation type study
CN102332170B (en) Method and system for generating computer sketch images
US20060214946A1 (en) Hardware accelerated anti-aliased primitives using alpha gradients
CN106886353B (en) Display processing method and device of user interface
CN109920012A (en) Image colorant system and method based on convolutional neural networks
JPH04168583A (en) Display method for image
US20010014175A1 (en) Method for rapid color keying of color video images using individual color component look-up-tables
CN110115841B (en) Rendering method and device for vegetation object in game scene
CN108664454A (en) E-book page display method, device and terminal device
CN112862943B (en) Virtual model rendering method and device, storage medium and electronic equipment
US9064336B2 (en) Multiple texture compositing
CN104077794A (en) Picture staining method and device
US5880735A (en) Method for and apparatus for transparency conversion, image processing system
JP4174133B2 (en) Image generation method
US6456295B1 (en) Method for simulating diffusion on a raster
CN114266855A (en) Light effect simulation method and device of dot matrix screen and electronic equipment
JP3352458B2 (en) Graphic Coloring Method for Graphic Display System

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