CN109544668A - Texture coordinate processing method, terminal device and computer readable storage medium - Google Patents

Texture coordinate processing method, terminal device and computer readable storage medium Download PDF

Info

Publication number
CN109544668A
CN109544668A CN201710860925.7A CN201710860925A CN109544668A CN 109544668 A CN109544668 A CN 109544668A CN 201710860925 A CN201710860925 A CN 201710860925A CN 109544668 A CN109544668 A CN 109544668A
Authority
CN
China
Prior art keywords
coordinate
texture
vertex
tile fragment
relative
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
CN201710860925.7A
Other languages
Chinese (zh)
Other versions
CN109544668B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710860925.7A priority Critical patent/CN109544668B/en
Publication of CN109544668A publication Critical patent/CN109544668A/en
Application granted granted Critical
Publication of CN109544668B publication Critical patent/CN109544668B/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
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures

Abstract

A kind of texture coordinate processing method, it is related to graphics plotting field, it include: to establish corresponding relative coordinate system respectively using a vertex of tile fragment belonging to dough sheet each in figure to be drawn as origin for the respectively tile fragment, the coordinate range of the relative coordinate system and the precision of graphics processor match;The coordinate on each vertex of the respectively dough sheet is converted into relative coordinate, which is each coordinate of the vertex in the relative coordinate system;The graphics processor is controlled by way of Linear Mapping, which is converted into texture coordinate.In addition, the present invention also provides a kind of terminal device and computer readable storage mediums.The problems such as present invention can reduce memory overhead, and shake or distortion occur for the scene for avoiding the occurrence of and rendering distortion, render.

Description

Texture coordinate processing method, terminal device and computer readable storage medium
Technical field
The present invention relates to graphics plotting field more particularly to a kind of texture coordinate processing methods, terminal device and meter Calculation machine readable storage medium storing program for executing.
Background technique
In three-dimensional rendering, usually to use and arrive texture coordinate.In the prior art, texture coordinate is usually by CPU (Central Processing Unit, central processing unit) pre-generatmg, then together with apex coordinate and other rendering datas In incoming GPU (Graphics Processing Unit, graphics processor), to be rendered to texture mapping.However, right The large area scene as map, on the one hand, since rendering data amount is very huge, the size of GPU data buffering can be serious Memory overhead when application program operation is influenced, EMS memory occupation is will lead to the texture coordinate data that apex coordinate is passed to GPU and adds Times.On the other hand, under large area scene, the texture coordinate generated using current texture coordinate processing method can not be accurate The problems such as indicating object space in scene, shake or distortion occurs so as to cause the scene for rendering distortion occur, rendering.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of texture coordinate processing method, terminal device and computer-readable deposits The problems such as storage media can reduce memory overhead, and shake or distortion occur for the scene for avoiding the occurrence of and rendering distortion, render.
First aspect of the embodiment of the present invention provides a kind of texture coordinate processing method, comprising: in figure to be drawn One vertex of tile fragment belonging to each dough sheet is origin, establishes corresponding relative coordinate system, the phase respectively for each tile fragment The precision of coordinate range and graphics processor to coordinate system matches;The coordinate on each vertex of each dough sheet is converted to Relative coordinate, the relative coordinate are coordinate of each vertex in the relative coordinate system;Control the graphics processor By way of Linear Mapping, the relative coordinate is converted into texture coordinate.
Second aspect of the embodiment of the present invention provides a kind of terminal device, comprising: establishment of coordinate system module, for wait draw A vertex of tile fragment belonging to each dough sheet is origin in the figure of system, establishes corresponding relative coordinate respectively for each tile fragment System, the coordinate range of the relative coordinate system and the precision of graphics processor match;Coordinate transferring, being used for will be each described The coordinate on each vertex of dough sheet is converted to relative coordinate, and the relative coordinate is each vertex in the relative coordinate system Coordinate;Control module is converted to the relative coordinate for controlling the graphics processor by way of Linear Mapping Texture coordinate.
The third aspect of the embodiment of the present invention provides a kind of terminal device, comprising: memory, processor and is stored in described It is real when the processor executes the computer program on memory and the computer program that can run on the processor The texture coordinate processing method that existing embodiments of the present invention first aspect provides.
Fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, is stored thereon with computer journey Sequence, when the computer program is executed by processor, at the texture coordinate that realization embodiments of the present invention first aspect provides Reason method.
The embodiment of the present invention, by establishing relative coordinate system for each tile fragment, and will be each in figure to be drawn After the apex coordinate of dough sheet is converted to the relative coordinate under relative coordinate system, it is passed to GPU, then by GPU by incoming relative coordinate Be converted to texture coordinate, on the one hand, by calculating texture coordinate in real time in the tinter of GPU, computing cost is extremely low in GPU, Therefore can reduce EMS memory occupation and reduce CPU operation it is happy, on the other hand, pass through using coordinate range and GPU precision phase Shake or distortion occur for matched relative coordinate system, the scene that can avoid occurring rendering distortion under large area scene, rendering The problems such as.
For above and other objects, features and advantages of the invention can be clearer and more comprehensible, preferred embodiment is cited below particularly, And cooperate institute's accompanying drawings, it is described in detail below.
Detailed description of the invention
Fig. 1 is the flow diagram for the texture coordinate processing method that one embodiment of the invention provides;
Fig. 2 be another embodiment of the present invention provides texture coordinate processing method flow diagram;
Fig. 3 be another embodiment of the present invention provides the tile fragment boundary discontinuous problem that solves of texture coordinate processing method Schematic diagram;
Fig. 4 is the structural schematic diagram for the terminal device that one embodiment of the invention provides;
Fig. 5 be another embodiment of the present invention provides terminal device structural schematic diagram;
Fig. 6 is the hardware structural diagram for the terminal device that one embodiment of the invention provides.
Specific embodiment
Further to illustrate that the present invention is the technical means and efficacy realizing predetermined goal of the invention and being taken, below in conjunction with Attached drawing and preferred embodiment, to specific embodiment, structure, feature and its effect according to the present invention, detailed description is as follows.
Referring to Fig. 1, Fig. 1 is the flow chart for the texture coordinate processing method that one embodiment of the invention provides.The present embodiment The texture coordinate processing method of offer may be applicable to carry out smart phone, tablet computer, the notebook of 3 D image drawing The electronic data device and other non-electronic data devices that can be used on the move that computer etc. can use on the move.Such as figure Shown in 1, this method is specifically included that
Step S101, using a vertex of tile fragment belonging to each dough sheet in figure to be drawn as origin, for the respectively tile fragment Corresponding relative coordinate system is established respectively;
Dough sheet is the minimum graphic element in figure rendering, is a kind of figure between two and three dimensions, there is three-dimensional Face but remain two-dimensional spline curve, can hereby handle reaches curved surface effect by adjusting the shellfish of dough sheet.It is drawn in 3-D graphic Software cloth, mountainous region, the water surface, polygonal region face and road surface etc. are generally drawn in system with dough sheet.
Tile fragment, grid in other words, for distinguishing different data areas.One complete figure is divided into multiple small Block, each block can be considered a tile fragment.The data cell usually disposably loaded is a tile fragment.In 3-D image In drafting, need that each dough sheet is attached in corresponding tile fragment using texture coordinate.
Choose each dough sheet in figure to be drawn respectively belonging to tile fragment a vertex, the coordinate on the vertex is repaired It is changed to O (0,0), then using the vertex as origin, respectively each tile fragment establishes corresponding relative coordinate system, that is, each watt Block corresponds to a new coordinate system.The coordinate range of the relative coordinate system and the precision of GPU match, with the mistake rendered in figure Cheng Zhong obtains the precision that the floating number of GPU indicates enough.
Step S102, the coordinate on each vertex of the respectively dough sheet is converted into relative coordinate, which is each top Coordinate of the point in the relative coordinate system;
Specifically, the coordinate on each vertex of each dough sheet is converted to the seat under the relative coordinate system created in step S101 Mark, that is, relative coordinate.The coordinate of conversion front and back is world coordinates, and the position of each vertex in conversion front and back in space is not sent out Raw any variation.
Step S103, the relative coordinate is converted to texture coordinate by way of Linear Mapping by control graphics processor.
Specifically, the relative coordinate on each vertex of each dough sheet after conversion is passed to GPU, and controls GPU and call coloring Incoming relative coordinate is converted to the texture coordinate for being used for figure rendering using linear coefficient by device, then according to conversion after Texture coordinate executes texture coordinate sampling operation in GPU accuracy rating.
Texture coordinate processing method provided in an embodiment of the present invention, by establishing relative coordinate system for each tile fragment, and After the apex coordinate of each dough sheet in figure wait draw is converted to the relative coordinate under relative coordinate system, it is passed to GPU, so Incoming relative coordinate is converted into texture coordinate by GPU afterwards, on the one hand, sit by calculating texture in real time in the tinter of GPU Mark, computing cost is extremely low in GPU, thus can reduce EMS memory occupation and reduce CPU operation it is happy, on the other hand, pass through utilization The relative coordinate system that the precision of coordinate range and GPU match can avoid occurring rendering distortion under large area scene, render Scene occur shake or distortion the problems such as.
Referring to Fig. 2, Fig. 2 is the flow chart for the texture coordinate processing method that one embodiment of the invention provides.The present embodiment The texture coordinate processing method of offer may be applicable to carry out smart phone, tablet computer, the notebook of 3 D image drawing The electronic data device and other non-electronic data devices that can be used on the move that computer etc. can use on the move.Such as figure Shown in 2, this method is specifically included that
It step S201, is each using the lower-left angular vertex of tile fragment belonging to each dough sheet in figure figure to be drawn as origin The tile fragment establishes corresponding relative coordinate system respectively;
Dough sheet is the minimum graphic element in figure rendering, is a kind of figure between two and three dimensions, there is three-dimensional Face but remain two-dimensional spline curve, can hereby handle reaches curved surface effect by adjusting the shellfish of dough sheet.It is drawn in 3-D graphic Software cloth, mountainous region, the water surface, polygonal region face and road surface etc. are generally drawn in system with dough sheet.
Tile fragment, grid in other words, for distinguishing different data areas.One complete figure is divided into multiple small Block, each block can be considered a tile fragment.The data cell usually disposably loaded is a tile fragment.In 3-D image In drafting, need that each dough sheet is attached in corresponding tile fragment using texture coordinate.
Using each dough sheet in figure to be drawn respectively belonging to tile fragment lower-left angular vertex as origin, each watt Block establishes corresponding relative coordinate system, that is, the corresponding new coordinate system of each tile fragment.The coordinate range of the relative coordinate system Match with the precision of GPU, during figure renders, to obtain the precision that the floating number of GPU indicates enough.
Step S202, the coordinate on each vertex of the respectively dough sheet is converted into relative coordinate, which is each top Coordinate of the point in the relative coordinate system;
Specifically, the coordinate on each vertex of each dough sheet is converted to the seat under the relative coordinate system created in step S201 Mark, that is, relative coordinate.Relative coordinate system for example can be two-dimensional Cartesian system.The coordinate of conversion front and back is that the world is sat Any variation does not occur for mark, the position of each vertex in conversion front and back in space.
Step S203, linear coefficient is obtained divided by the length and width of the tile fragment using the quantity of the texture of tiling;
Specifically, utilizing spread factor ratio X=texWidth/geoWidth and length factor ratio Y= TexLength/geoLength obtains linear coefficient ratio (ratioX, ratioY)=(tx/ (bx-ax), ty/ (by- ay));
Spread factor ratio X is the linear coefficient of U in texture coordinate (column) coordinate components, and wherein texWidth is each The texture coordinate width range of the integral multiple of a tile fragment, geoWidth are the geographical coordinate width ranges of each tile fragment.
Length factor ratio Y is the linear coefficient of V in texture coordinate (row) coordinate components, and wherein texLength/ is every The texture coordinate length range of the integral multiple of one tile fragment, geoLength are the geographical coordinate length ranges of each tile fragment.Ground Managing coordinate is the spherical coordinate that ground point location is indicated with latitude, longitude.Texture coordinate is the coordinate in texture space.
In practical applications, texture mapping is superimposed preset line usually using repeat (repetition) mode repeatedly in map Manage image.The texture coordinate period is usually 0~1,0 identical as 1 and all integral multiple texture coordinate sampled values.Using opposite After coordinate system, due to the corresponding new relative coordinate system of each tile fragment, and the coordinate model between each relative coordinate system It is discrete for enclosing, and in order to avoid there is the discontinuous problem in tile fragment boundary as shown in Figure 3, is needed each relative coordinate system Coordinate range is set as the multiple of integer.
In other words, the corresponding texture coordinate of the starting point of a tile fragment is usually (0,0), which is simultaneously upper one The end point of a tile fragment, it is therefore desirable to guarantee that the corresponding texture coordinate of the end point of each tile fragment is integer.Based on above-mentioned It is required that being geoWidth for a width, length is the tile fragment of geoLength, only need to be by providing that the tile fragment range is corresponding Integral multiple texture coordinate width and length range texWidth and texLength, can obtain seamless in tile fragment boundary The successional tile fragment of linking, so as to effectively avoid the occurrence of the discontinuous problem in tile fragment boundary.
Further, it is assumed that the corresponding texture coordinate range of the distance between two neighboring vertex a and b of dough sheet difference For (tx, ty);
Then, spread factor ratioX=texWidth/geoWidth and length factor ratioY=texLength/ are utilized GeoLength determines linear coefficient are as follows:
Ratio (ratioX, ratioY)=(tx/ (bx-ax), ty/ (by-ay));
RatioX=texWidth/geoWidth=tx/ (bx-ax)=(u2-u1)/(bx-ax);
RatioY=texLength/geoLength=ty/ (by-ay))=(v2-v1)/(by-ay);
Wherein, bx is coordinate value of the vertex b in the x-axis of the relative coordinate system, and ax is x of the vertex a in the relative coordinate system The coordinate value of axis, by are coordinate value of the vertex b in the y-axis of the relative coordinate system, and ay is y-axis of the vertex a in the relative coordinate system Coordinate value.
In practical applications, texture coordinate range (tx, ty) is variation according to the needs of design.The shape of tile fragment can be with It is square, rectangle or other irregular shapes.
Further, in other embodiments of the invention, also the texture coordinate of tile fragment can be determined according to the precision of GPU The precision of width range and length range, GPU is smaller, and the texture coordinate width range and length range of tile fragment are smaller, with into one Step guarantees that the coordinate range of relative coordinate system and the precision of GPU match.Wherein the precision of GPU for example can be, but not limited to wrap Include: 16bit (bit), 10bit and 8bit respectively correspond high, medium and low accuracy floating-point number.
Step S204, figure graphics processor is passed to using the relative coordinate and the linear coefficient as coordinate parameters;
Specifically, GPU can be passed to using linear coefficient as uniform parameter.In another embodiment of the present invention, it can also incite somebody to action Linear coefficient is preset in GPU.
Step S205, control the graphics processor by by the relative coordinate on the respectively vertex multiplied by the linear coefficient, by this Relative coordinate is converted to texture coordinate.
Specifically, GPU calls tinter, by by the relative coordinate on each vertex multiplied by linear coefficient, phase that will be incoming Coordinate is converted to and is held in GPU accuracy rating for the texture coordinate of figure rendering then according to the texture coordinate after conversion Row texture coordinate sampling operation, and further execute the operation of figure rendering.
For map render scenes being lifted below, the generating process of above-mentioned texture coordinate is further illustrated.
Polygonal region face and road surface are usually made of numerous triangle surfaces in map render scenes.Most for one Junior unit, i.e. triangle ABC, it is assumed that the apex coordinate of three of them vertex A, B, C are respectively (10000000,20000000) A, B (10000001,20000000), C (10000000,20000001).The lower-left angular vertex of the affiliated map tile fragment X of triangle ABC Coordinate is T (10000000,20000000), and the width of tile fragment X is 1024.
Under normal conditions, the 16bit high-precision floating number that the GPU of mobile terminal can be indicated, is only capable of accurately expressing ten System 5~6.The precision that GPU floating number indicates enough in order to obtain, using tile fragment X lower-left angular vertex as origin, by its coordinate T (10000000,20000000) is revised as O (0,0), under the new coordinate system expressed by T (relative coordinate system), triangle Coordinate value represented by tri- vertex A, B and C of ABC is respectively At (0,0), Bt (1,0) and Ct (0,1).
It should be noted that any variation does not occur for the position of tri- vertex A, B and C in space, coordinate system Variation has no effect on the position of object and relativeness in three-dimensional space.Under new coordinate system, the ginseng of video camera (Camera) Number is also changed, but only affects viewing matrix.It can be floated with GPU to obtain the new of tri- vertex A, B and C The coordinate value of points accurate expression.
Then, tri- vertex A, the B and C position of triangle ABC is obtained in GPU by Linear Mapping in texture Texture coordinate in space.If being incited somebody to action specifically, corresponding texture coordinate range is (tx, ty) between B to C in design requirement The relative coordinate and linear coefficient ratio (ratioX, ratioY) of vertex A, B, C=(tx/ (bx-ax), ty/ (by-ay)) It is passed in GPU as uniform parameter, the relative coordinate on incoming each vertex is obtained each top multiplied by the linear coefficient by GPU The texture coordinate of point.The process of above-mentioned coordinate conversion, can complete on vertex or pixel shader stage.In a practical application example In, above-mentioned coordinate can be realized by the code of following OpenGL (OpenGL Shading Language, shading language) tinter Conversion.
Texture coordinate processing method provided in an embodiment of the present invention, by establishing relative coordinate system for each tile fragment, and After the apex coordinate of each dough sheet in figure wait draw is converted to the relative coordinate under relative coordinate system, it is passed to GPU, so Incoming relative coordinate is converted into texture coordinate by GPU afterwards, on the one hand, sit by calculating texture in real time in the tinter of GPU Mark, computing cost is extremely low in GPU, thus can reduce EMS memory occupation and reduce CPU operation it is happy, on the other hand, pass through utilization The relative coordinate system that the precision of coordinate range and GPU match can avoid occurring rendering distortion under large area scene, render Scene occur shake or distortion the problems such as.
Fig. 4 is the structural schematic diagram for the terminal device that one embodiment of the invention provides.The present embodiment is for realizing above-mentioned Fig. 1 Texture coordinate processing method in illustrated embodiment.As shown in figure 4, terminal device provided in this embodiment includes:
Establishment of coordinate system module 401, for being original with a vertex of tile fragment belonging to each dough sheet in figure to be drawn Point establishes corresponding relative coordinate system, the coordinate range of the relative coordinate system and the essence of graphics processor for the respectively tile fragment respectively Degree matches;
Coordinate transferring 402, for the coordinate on each vertex of the respectively dough sheet to be converted to relative coordinate, the opposite seat Mark is each coordinate of the vertex in the relative coordinate system;
Control module 403 is converted to the relative coordinate for controlling the graphics processor by way of Linear Mapping Texture coordinate.
The detailed process of the respective function of each Implement of Function Module, refers in above-mentioned embodiment illustrated in fig. 1 in the present embodiment The particular content of description, details are not described herein again.
In the embodiment of the present invention, by establishing relative coordinate system for each tile fragment, and will be each in figure to be drawn After the apex coordinate of a dough sheet is converted to the relative coordinate under relative coordinate system, it is passed to GPU, opposite seat then will be passed to by GPU Mark is converted to texture coordinate, on the one hand, by calculating texture coordinate in real time in the tinter of GPU, computing cost pole in GPU It is low, thus can reduce EMS memory occupation and reduce CPU operation it is happy, on the other hand, pass through using coordinate range and GPU precision The relative coordinate system to match, the scene that can avoid occurring rendering distortion under large area scene, rendering occur shake or turn round The problems such as bent.
Fig. 5 be another embodiment of the present invention provides terminal device structural schematic diagram.The present embodiment is for realizing above-mentioned Texture coordinate processing method in embodiment illustrated in fig. 2.As shown in figure 5, terminal device provided in this embodiment includes:
Establishment of coordinate system module 401, for being original with a vertex of tile fragment belonging to each dough sheet in figure to be drawn Point establishes corresponding relative coordinate system, the coordinate range of the relative coordinate system and the essence of graphics processor for the respectively tile fragment respectively Degree matches;
Coordinate transferring 402, for the coordinate on each vertex of the respectively dough sheet to be converted to relative coordinate, the opposite seat Mark is each coordinate of the vertex in the relative coordinate system;
Control module 403 is converted to the relative coordinate for controlling the graphics processor by way of Linear Mapping Texture coordinate.
Further, control module 403 are also used to control the graphics processor by multiplying the relative coordinate on the respectively vertex With linear coefficient, which is converted into the texture coordinate;
Where it is assumed that the corresponding texture coordinate range of range difference of the two neighboring vertex a and b of the dough sheet is (tx, ty), Then, the linear coefficient are as follows:
Ratio (ratioX, ratioY)=(tx/ (bx-ax), ty/ (by-ay)),
Wherein, spread factor ratioX is the linear coefficient of U coordinate component in texture coordinate, and length factor ratioY is line The linear coefficient of V coordinate components in coordinate is managed, bx is coordinate value of the vertex b in the x-axis of the relative coordinate system, and ax is that vertex a exists The coordinate value of the x-axis of the relative coordinate system, by are coordinate value of the vertex b in the y-axis of the relative coordinate system, and ay is vertex a at this The coordinate value of the y-axis of relative coordinate system.
Further, the terminal device further include:
Afferent module 501, for being passed to the graphics processor using the relative coordinate and the linear coefficient as coordinate parameters.
Further, establishment of coordinate system module 401, specifically for tile fragment belonging to each dough sheet in figure to be drawn Lower-left angular vertex is origin, establishes corresponding relative coordinate system respectively for the respectively tile fragment.
Further, the terminal device further include:
Module 502 is obtained, the quantity for the texture using tiling obtains described divided by the length and width of the tile fragment Linear coefficient.
Further, module 502 is obtained to be specifically used for utilizing ratioX=texWidth/geoWidth and ratioY= TexLength/geoLength obtains linear coefficient ratio (ratioX, ratioY);Wherein, texWidth is the tile fragment Integral multiple texture coordinate width range, geoWidth is the geographical coordinate width range of the tile fragment, and texLength is this watt The texture coordinate length range of the integral multiple of block, geoLength are the geographical coordinate length ranges of the tile fragment.
Further, the terminal device further include:
Determining module 503, for the precision according to the graphics processor, determine the tile fragment texture coordinate width range and The precision of length range, the graphics processor is smaller, and the texture coordinate width range and length range of the tile fragment are smaller.
The detailed process of the respective function of each Implement of Function Module in the present embodiment refers to and implements shown in above-mentioned Fig. 1 to Fig. 4 Particular content described in example, details are not described herein again.
In the embodiment of the present invention, by establishing relative coordinate system for each tile fragment, and will be each in figure to be drawn After the apex coordinate of a dough sheet is converted to the relative coordinate under relative coordinate system, it is passed to GPU, opposite seat then will be passed to by GPU Mark is converted to texture coordinate, on the one hand, by calculating texture coordinate in real time in the tinter of GPU, computing cost pole in GPU It is low, thus can reduce EMS memory occupation and reduce CPU operation it is happy, on the other hand, pass through using coordinate range and GPU precision The relative coordinate system to match, the scene that can avoid occurring rendering distortion under large area scene, rendering occur shake or turn round The problems such as bent.
Referring to Fig. 6, Fig. 6 is the hardware structure diagram for the terminal device that one embodiment of the invention provides.
Terminal device as described in this embodiment, comprising:
Memory 51, processor 52 and it is stored in the computer program that can be run on memory 51 and on the processor 52, When processor 52 executes the computer program, realize earlier figures 1 to texture coordinate processing side described in embodiment illustrated in fig. 3 Method.
Further, the terminal device further include:
At least one input equipment 53 and at least one output equipment 54.
Above-mentioned memory 51, processor 52, input equipment 53 and output equipment 54 are connected by bus 55.
Wherein, input equipment 53 concretely camera, touch panel, physical button or mouse etc..Output equipment 54 concretely display screens.
Memory 51 can be high random access memory body (RAM, Random Access Memory) memory, can also For non-labile memory (non-volatile memory), such as magnetic disk storage.Memory 51 can for storing one group Program code is executed, processor 52 is coupled with memory 51.
Further, the embodiment of the invention also provides a kind of computer readable storage medium, the computer-readable storages Medium can be in the terminal device being set in the various embodiments described above, which can be earlier figures 6 Memory in illustrated embodiment.It is stored with computer program on the computer readable storage medium, which is located Manage realizes earlier figures 1 to texture coordinate processing method described in embodiment illustrated in fig. 3 when device executes.Further, the calculating Machine can storage medium can also be USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), RAM, magnetic disk or The various media that can store program code such as person's CD.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that process, method, article or device including a series of elements are not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or device Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or device including the element.
It will be appreciated by those skilled in the art that realizing that all or part of the steps of above-described embodiment can be by hardware come complete At relevant hardware can also being instructed to complete by program, the program can store in a kind of computer-readable storage In medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The above described is only a preferred embodiment of the present invention, be not intended to limit the present invention in any form, though So the present invention has been disclosed as a preferred embodiment, and however, it is not intended to limit the invention, any technology people for being familiar with this profession Member, without departing from the scope of the present invention, when the technology contents using the disclosure above are modified or are modified It is right according to the technical essence of the invention for the equivalent embodiment of equivalent variations, but without departing from the technical solutions of the present invention Any simple modification, equivalent change and modification made by above embodiments, all of which are still within the scope of the technical scheme of the invention.

Claims (13)

1. a kind of texture coordinate processing method, which is characterized in that the described method includes:
Using a vertex of tile fragment belonging to each dough sheet in figure to be drawn as origin, correspondence is established respectively for each tile fragment Relative coordinate system, the coordinate range of the relative coordinate system and the precision of graphics processor match;
The coordinate on each vertex of each dough sheet is converted into relative coordinate, the relative coordinate is each vertex described Coordinate in relative coordinate system;
The graphics processor is controlled by way of Linear Mapping, the relative coordinate is converted into texture coordinate.
2. texture coordinate processing method as described in claim 1, which is characterized in that the control graphics processor passes through The relative coordinate is converted to texture coordinate by the mode of Linear Mapping, comprising:
The graphics processor is controlled by the way that the relative coordinate multiplied by linear coefficient, to be turned to the relative coordinate on each vertex It is changed to the texture coordinate;
Where it is assumed that the corresponding texture coordinate range of range difference of the two neighboring vertex a and b of the dough sheet is (tx, ty), Then, the linear coefficient are as follows:
Ratio (ratioX, ratioY)=(tx/ (bx-ax), ty/ (by-ay)),
Wherein, spread factor ratioX is the linear coefficient of U coordinate component in texture coordinate, and length factor ratioY is texture seat The linear coefficient of V coordinate components in mark, bx are vertex b in the coordinate value of the x-axis of the relative coordinate system, and ax is vertex a in institute The coordinate value of the x-axis of relative coordinate system is stated, by is coordinate value of the vertex b in the y-axis of the relative coordinate system, and ay is that vertex a exists The coordinate value of the y-axis of the relative coordinate system.
3. texture coordinate processing method as claimed in claim 2, which is characterized in that the control graphics processor passes through The relative coordinate on each vertex is also wrapped before the relative coordinate is converted to the texture coordinate multiplied by linear coefficient It includes:
Using tiling texture quantity divided by the length and width of the tile fragment, obtain the linear coefficient.
4. texture coordinate processing method as claimed in claim 3, which is characterized in that the quantity of the texture using tiling is removed With the length and width of the tile fragment, the linear coefficient is obtained, is specifically included:
Using ratioX=texWidth/geoWidth and ratioY=texLength/geoLength, the linear system is obtained Number ratio (ratioX, ratioY);
Wherein, texWidth is the texture coordinate width range of the integral multiple of the tile fragment, and geoWidth is the ground of the tile fragment Coordinate width range is managed, texLength is the texture coordinate length range of the integral multiple of the tile fragment, and geoLength is described The geographical coordinate length range of tile fragment.
5. texture coordinate processing method as claimed in claim 4, which is characterized in that the method also includes:
According to the precision of the graphics processor, the texture geographical coordinate width range and length range of the tile fragment, institute are determined The precision for stating graphics processor is smaller, and the texture coordinate width range and length range of the tile fragment are smaller.
6. the texture coordinate processing method as described in any one of claim 2 to 5, which is characterized in that described in the control Graphics processor is by, multiplied by linear coefficient, being converted to the texture for the relative coordinate for the relative coordinate on each vertex Before coordinate, further includes:
The graphics processor is passed to using the relative coordinate and the linear coefficient as coordinate parameters.
7. texture coordinate processing method according to any one of claims 1 to 5, which is characterized in that described wait draw Figure in a vertex of tile fragment belonging to each dough sheet be origin, establish corresponding relative coordinate system respectively for each tile fragment Include:
Using the lower-left angular vertex of tile fragment belonging to each dough sheet in figure to be drawn as origin, established respectively pair for each tile fragment The relative coordinate system answered.
8. a kind of terminal device characterized by comprising
Establishment of coordinate system module is each for a vertex using tile fragment belonging to each dough sheet in figure to be drawn as origin The tile fragment establishes corresponding relative coordinate system, the coordinate range and the precision phase of graphics processor of the relative coordinate system respectively Matching;
Coordinate transferring, for the coordinate on each vertex of each dough sheet to be converted to relative coordinate, the relative coordinate It is coordinate of each vertex in the relative coordinate system;
The relative coordinate is converted to line for controlling the graphics processor by way of Linear Mapping by control module Manage coordinate.
9. terminal device as claimed in claim 8, which is characterized in that
The control module is also used to control the graphics processor by being multiplied by linear by the relative coordinate on each vertex Number, is converted to the texture coordinate for the relative coordinate;
Where it is assumed that the corresponding texture coordinate range of range difference of the two neighboring vertex a and b of the dough sheet is (tx, ty), Then, the linear coefficient are as follows:
Ratio (ratioX, ratioY)=(tx/ (bx-ax), ty/ (by-ay)),
Wherein, spread factor ratioX is the linear coefficient of U coordinate component in texture coordinate, and length factor ratioY is texture seat The linear coefficient of V coordinate components in mark, bx are vertex b in the coordinate value of the x-axis of the relative coordinate system, and ax is vertex a in institute The coordinate value of the x-axis of relative coordinate system is stated, by is coordinate value of the vertex b in the y-axis of the relative coordinate system, and ay is that vertex a exists The coordinate value of the y-axis of the relative coordinate system.
10. terminal device as claimed in claim 9, which is characterized in that
The terminal device further include:
Module is obtained, the quantity for the texture using tiling obtains the linear system divided by the length and width of the tile fragment Number;
The acquisition module is specifically used for utilizing ratioX=texWidth/geoWidth and ratioY=texLength/ GeoLength obtains the linear coefficient ratio (ratioX, ratioY);
Wherein, texWidth is the texture coordinate width range of the integral multiple of the tile fragment, and geoWidth is the ground of the tile fragment Coordinate width range is managed, texLength is the texture coordinate length range of the integral multiple of the tile fragment, and geoLength is described The geographical coordinate length range of tile fragment;
The terminal device further include:
Determining module determines the texture coordinate width range and length of the tile fragment for the precision according to the graphics processor Range is spent, the precision of the graphics processor is smaller, and the texture coordinate width range and length range of the tile fragment are smaller.
11. the terminal device as described in any one of claim 8 to 10, which is characterized in that the terminal device further include:
Afferent module, for being passed to the graphics processor using the relative coordinate and the linear coefficient as coordinate parameters;
The establishment of coordinate system module is specifically for the lower-left angular vertex with tile fragment belonging to each dough sheet in figure to be drawn Origin establishes corresponding relative coordinate system for each tile fragment respectively.
12. a kind of terminal device, comprising: memory, processor and be stored on the memory and can be on the processor The computer program of operation, which is characterized in that when the processor executes the computer program, realize such as claim 1 to 7 Any one of described in texture coordinate processing method.
13. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program When being executed by processor, texture coordinate processing method according to any one of claims 1 to 7 is realized.
CN201710860925.7A 2017-09-21 2017-09-21 Texture coordinate processing method, terminal device and computer readable storage medium Active CN109544668B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710860925.7A CN109544668B (en) 2017-09-21 2017-09-21 Texture coordinate processing method, terminal device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710860925.7A CN109544668B (en) 2017-09-21 2017-09-21 Texture coordinate processing method, terminal device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109544668A true CN109544668A (en) 2019-03-29
CN109544668B CN109544668B (en) 2022-10-25

Family

ID=65828266

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710860925.7A Active CN109544668B (en) 2017-09-21 2017-09-21 Texture coordinate processing method, terminal device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109544668B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287431A (en) * 2019-06-27 2019-09-27 北京金山安全软件有限公司 Image file loading method and device, electronic equipment and storage medium
CN112307139A (en) * 2019-07-30 2021-02-02 阿里巴巴集团控股有限公司 Data processing method, device, server and storage medium
CN112819939A (en) * 2021-03-08 2021-05-18 网易(杭州)网络有限公司 Method, apparatus, device and computer readable storage medium for correcting UV coordinates
CN114529706A (en) * 2022-04-22 2022-05-24 三一筑工科技股份有限公司 Method, device, equipment and medium for splitting target object in three-dimensional model
CN116048531A (en) * 2023-03-30 2023-05-02 南京砺算科技有限公司 Instruction compiling method, graphic processing unit, storage medium and terminal equipment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6744442B1 (en) * 2000-08-29 2004-06-01 Harris Corporation Texture mapping system used for creating three-dimensional urban models
US20050219241A1 (en) * 2004-04-05 2005-10-06 Won Chun Processing three dimensional data for spatial three dimensional displays
US7659893B1 (en) * 2006-10-02 2010-02-09 Nvidia Corporation Method and apparatus to ensure consistency of depth values computed in different sections of a graphics processor
CN102147930A (en) * 2011-04-13 2011-08-10 北京农业信息技术研究中心 Texture mapping method for three-dimensional curved surface of irregular plant leaf
CN102426712A (en) * 2011-11-03 2012-04-25 中国科学院自动化研究所 Three-dimensional head modeling method based on two images
US20120101790A1 (en) * 2010-10-25 2012-04-26 Vistaprint Technologies Limited Embroidery image rendering using parametric texture mapping
CN103021013A (en) * 2012-11-28 2013-04-03 无锡羿飞科技有限公司 High-efficiency processing method for spherical display and rotary output image of projector
US20130106834A1 (en) * 2011-11-02 2013-05-02 Visual Technology Services Limited Compression of texture rendered wire mesh models

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6744442B1 (en) * 2000-08-29 2004-06-01 Harris Corporation Texture mapping system used for creating three-dimensional urban models
US20050219241A1 (en) * 2004-04-05 2005-10-06 Won Chun Processing three dimensional data for spatial three dimensional displays
US7659893B1 (en) * 2006-10-02 2010-02-09 Nvidia Corporation Method and apparatus to ensure consistency of depth values computed in different sections of a graphics processor
US20120101790A1 (en) * 2010-10-25 2012-04-26 Vistaprint Technologies Limited Embroidery image rendering using parametric texture mapping
CN102147930A (en) * 2011-04-13 2011-08-10 北京农业信息技术研究中心 Texture mapping method for three-dimensional curved surface of irregular plant leaf
US20130106834A1 (en) * 2011-11-02 2013-05-02 Visual Technology Services Limited Compression of texture rendered wire mesh models
CN102426712A (en) * 2011-11-03 2012-04-25 中国科学院自动化研究所 Three-dimensional head modeling method based on two images
CN103021013A (en) * 2012-11-28 2013-04-03 无锡羿飞科技有限公司 High-efficiency processing method for spherical display and rotary output image of projector

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘浩: "多尺度三维灾情场景构建与动态标绘关键技术研究", 《中国博士学位论文全文数据库 基础科学辑》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287431A (en) * 2019-06-27 2019-09-27 北京金山安全软件有限公司 Image file loading method and device, electronic equipment and storage medium
CN110287431B (en) * 2019-06-27 2021-08-24 北京金山安全软件有限公司 Image file loading method and device, electronic equipment and storage medium
CN112307139A (en) * 2019-07-30 2021-02-02 阿里巴巴集团控股有限公司 Data processing method, device, server and storage medium
CN112819939A (en) * 2021-03-08 2021-05-18 网易(杭州)网络有限公司 Method, apparatus, device and computer readable storage medium for correcting UV coordinates
CN112819939B (en) * 2021-03-08 2023-07-07 网易(杭州)网络有限公司 Method, apparatus, device and computer readable storage medium for correcting UV coordinates
CN114529706A (en) * 2022-04-22 2022-05-24 三一筑工科技股份有限公司 Method, device, equipment and medium for splitting target object in three-dimensional model
CN114529706B (en) * 2022-04-22 2022-07-08 三一筑工科技股份有限公司 Method, device, equipment and medium for splitting target object in three-dimensional model
CN116048531A (en) * 2023-03-30 2023-05-02 南京砺算科技有限公司 Instruction compiling method, graphic processing unit, storage medium and terminal equipment
CN116048531B (en) * 2023-03-30 2023-08-08 南京砺算科技有限公司 Instruction compiling method, graphic processing device, storage medium and terminal equipment

Also Published As

Publication number Publication date
CN109544668B (en) 2022-10-25

Similar Documents

Publication Publication Date Title
CN109544668A (en) Texture coordinate processing method, terminal device and computer readable storage medium
US11301956B2 (en) Varying effective resolution by screen location by altering rasterization parameters
KR101925292B1 (en) Gradient adjustment for texture mapping to non-orthonormal grid
KR101916341B1 (en) Gradient adjustment for texture mapping for multiple render targets with resolution that varies by screen location
TWI552109B (en) A method, a non-transitory computer-readable storage medium and a system for conservative rasterization of primitives using an error term
US20230053462A1 (en) Image rendering method and apparatus, device, medium, and computer program product
KR101922482B1 (en) Varying effective resolution by screen location by changing active color sample count within multiple render targets
CN101116111B (en) 2d/3d line rendering using 3d rasterization algorithms
TWI578266B (en) Varying effective resolution by screen location in graphics processing by approximating projection of vertices onto curved viewport
CN102184514B (en) Grouping pixels to be textured
Livny et al. A GPU persistent grid mapping for terrain rendering
WO2018151870A1 (en) Texture residency hardware enhancements for graphics processors
CN109871841A (en) Image processing method, device, terminal and storage medium
CN112017101A (en) Variable rasterization ratio
CN107038729A (en) A kind of digital meter panel method for drafting based on OpenGL ES
CN110706149B (en) Lightning particle rendering method and device
CN101477674A (en) Method for data computation assistance by display card
CN106803279A (en) It is a kind of to optimize the method for drawing sky
CN109658495A (en) Rendering method, device and the electronic equipment of environment light screening effect
CN106033451B (en) A kind of instant rendering method of the density map of cellular traffic and device
US11348287B2 (en) Rendering of graphic objects with pattern paint using a graphics processing unit
US20140354627A1 (en) Rendering a 3d shape
WO2011082651A1 (en) Method and apparatus for judging occlusion type of spatial entity
KR100684558B1 (en) Texture mipmapping device and the same method
US20220005261A1 (en) Method for instant rendering of voxels

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