CN104966313B - The geometrical shadow drawing method that triangle is rebuild - Google Patents

The geometrical shadow drawing method that triangle is rebuild Download PDF

Info

Publication number
CN104966313B
CN104966313B CN201510320994.XA CN201510320994A CN104966313B CN 104966313 B CN104966313 B CN 104966313B CN 201510320994 A CN201510320994 A CN 201510320994A CN 104966313 B CN104966313 B CN 104966313B
Authority
CN
China
Prior art keywords
triangle
pixel
geometrical shadow
shadow
geometrical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510320994.XA
Other languages
Chinese (zh)
Other versions
CN104966313A (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.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
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 Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN201510320994.XA priority Critical patent/CN104966313B/en
Publication of CN104966313A publication Critical patent/CN104966313A/en
Application granted granted Critical
Publication of CN104966313B publication Critical patent/CN104966313B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses the geometrical shadow drawing method that a kind of triangle is rebuild, including:(1) scene is drawn in light source space, generates and store geometrical shadow figure;(2) obtained geometrical shadow figure is compressed based on GPU, the geometrical shadow figure after being compressed;(3) scene is drawn in ken space, pixel is packed, then by triangle consistency check, the depth value of pixel shelter is rebuild with the triangle geometry of storage;(4) compare the pixel depth of light source space and the depth value of shelter, obtain shade result of calculation, complete the reconstruction of geometrical shadow figure.The present invention is directed to losing shape in shade drawing method and the problem of depth migration, and being represented and recorded the information of shadow occlusion thing using the original tri patch of discrete scene, there is provided a kind of geometrical shadow drawing method.While high-quality shade is generated, the inventive method possesses certain advantage on geometric data storage overhead and performance with respect to other algorithms, can preferably meet the demand applied in real time.

Description

The geometrical shadow drawing method that triangle is rebuild
Technical field
The present invention relates to computer graphics shade drafting field, and in particular to the geometrical shadow figure that a kind of triangle is rebuild Method.
Background technology
Shade is one of important subject during computer graphics implementation is drawn, and it can increase the true of composograph True feeling, helps user effectively to differentiate the position relationship of object in scene.Echo (shadow mapping, SM) and umbra volume (shadow volume) is two kinds of main methods of shade drafting.Wherein, shade drawing method is using the widest in shade drafting General method, but it is obtained and recorded the depth information of shadow occlusion thing using discrete point sampling, this can cause to lose shape And the problem of depth migration.
Dai etc. proposed shade drawing method (the reconstructable geometry of geometrical reconstruction in 2008 Shadow maps, RGSM) solve the problems, such as losing shape in shade drawing method and depth migration.Its main thought is:In light source Space rasterizes scene, and the triangle geometry that blocks each pixel center from viewpoint recently is stored;For each picture Element, the depth value of its shelter can use the triangle geometry information of storage, be obtained by linear interpolation.Although RGSM can be compared with Solve the problems, such as well to lose shape and depth migration, but there are three important defects:Need larger geological information memory space, visit Ask geometry cache cost the high shade mistake with geological information caused by imperfect.
A kind of Recreatable geometric shade pattern method disclosed in the Chinese patent literature of application number 200810096135.7, it is special Levy and be, including:
Using a light source as point of observation, the geological information of multiple shading triangles of a thing body front surface is stored;
Uniformity test is carried out to a test pixel, to find out the corresponding and test from the multiple shading triangle One shading triangle of pixel;
Rebuild the depth value of the chopping point relative to the test pixel;And perform the shade judgement of the test pixel;
Wherein, the coordinate of the test pixel is (p.x, p.y, p.z), and the uniformity test includes:
Select one of the multiple shading triangle;
The geological information of selected shading triangle is read, the geological information of the selected shading triangle includes The selected shading vertex of a triangle coordinate (v0.x, v0.y, v0.z)、(v1.x, v1.y, v1.z)、(v2.x, v2.y, v2.z);
Calculation equationTo ask for the barycentric coodinates value of the chopping point (w1, w2, w3);
Barycentric coodinates value (w according to the chopping point1, w2, w3) judge whether the selected shading triangle is consistent 's;And if the selected shading triangle judged result is consistent, the selected shading triangle is corresponding In the shading triangle of the test pixel;
Rebuilding the depth value of the chopping point includes:
Calculation equationTo ask for the depth value T.z of the chopping point.
A kind of Recreatable geometric shade pattern method, is only deposited disclosed in the Chinese patent literature of application number 200810096135.7 Shading triangle is stored up, it is still incomplete for whole scene, and it can cause partial pixel can not be in echo In find corresponding shelter geometry, so as to cause the not high phenomenon of depth value precision to produce.
The content of the invention
The present invention is avoided that to lose shape there is provided one kind and asked with depth migration for the shade drawing method deficiency of existing geometrical reconstruction Topic is produced, and effectively ensures the geometrical shadow drawing method that the triangle of depth value precision is rebuild.
The technical solution adopted by the present invention is:
The geometrical shadow drawing method that a kind of triangle is rebuild, including:
(1) scene is drawn in light source space, generates and store geometrical shadow figure;
In the geometric coloration stage of rendering pipeline, the operation of conservative rasterisation is added, the screening of each pixel is preserved Triangle is kept off, and this blocks three sides adjoining triangle of triangle;
(2) the geometrical shadow figure that step (1) is obtained is compressed based on GPU to reduce geometrical shadow figure intermediate cam shape Redundancy, the index map of geometrical shadow figure and geometrical shadow figure size after being compressed;
(3) scene is drawn in ken space, pixel is packed according to 2 × 2 pixel regions, then carry out triangle uniformity Check, according to inspection result, current screen picture is rebuild accordingly with the triangle geometry stored in the geometrical shadow figure after compression The depth value of the shelter of element;
(4) compare the depth value of the pixel depth of light source space and the shelter of step (3), determine shade result of calculation, To complete the reconstruction of geometrical shadow figure.
Preferably, when carrying out conservative rasterisation in step (1), the pixel region covered to blocking triangle was carried out Estimation, and by estimated result record in geometrical shadow figure.
Due to the limited resolution of geometrical shadow figure, the triangle of some projected areas " small " or " elongated ", which can not be covered, appoints What texel center, it is difficult to be stored in geometrical shadow figure.And for the pixel near shadow outline line, it is corresponding to block three It is angular can blocking in some texels only small area, and such block information will also tend to lose.Lost to record these The triangle or delta-shaped region of mistake, the present invention carried out estimation using conservative rasterisation to the overlay area of triangle, made it It is recorded in as much as possible in geometrical shadow figure.
Preferably, each pixel correspondence of the geometrical shadow figure stores six vertex datas, including:Central shielding Other three summits that three summits of triangle and three side adjoining triangles are related to.
Geometrical shadow figure storage triangle information representing is substantially that traditional shade drawing method is instead of with continuous original geometry In discrete sampling depth information.But because geometrical shadow figure is the geological information based on rasterisation generation, it is for whole It is still incomplete for scene, it can cause partial pixel can not find corresponding shelter geometry in echo.For Compensation this point, the present invention not only stores its triangle that blocks for each pixel, can also store and blocks the three of triangle Individual side abuts triangle.Geometry colouring function directly supports the topological relation that triangle edges are abutted in current main-stream hardware, efficiently Ground obtains the geometry that side abuts triangle.
Preferably, in geometrical shadow figure, the x and y coordinates of triangular apex are stored as 16-bit forms, and z coordinate is deposited Store up as 32-bit forms, so effectively ensure the precision of depth value.
Preferably, the compression of geometrical shadow figure is as follows in step (2):
(a) the sequence number figure of a dough sheet is generated while generating geometrical shadow figure, and records each texel in geometry Original position in echo;
(b) double tune merger sequences are carried out to sequence number according to the sequence number figure of dough sheet, then extracts sequence number using parallel algorithm In non-duplicate sequence number, while make correspondence texel positional information it is synchronous with serial number information change;
(c) original positional information is reused after sorting new sequence number figure is obtained to the sequence number progress order recovery of dough sheet;
(d) a read-write texture is created according to new sequence number figure, the geological information of nonredundancy in corresponding dough sheet is write Enter wherein, and generate the geometrical shadow figure after described compression and the index map of geometrical shadow figure size.
A depth value, the triangle geometry of the inventive method storage are stored relative to each texel of traditional shade drawing method Need more memory spaces.In fact, the triangle that blocks of adjacent texel storage is probably same three in geometrical shadow figure Angular, it means that to there is bulk redundancy in the geometric data of storage, the space of geometrical shadow figure can be compressed.Therefore originally Inventive method provides One function option, and user can select the precomputation being compressed to geometrical shadow figure, reduce method Storage overhead and run time.The function is particularly suitable for use in scene (such as indoor field in 3d gaming of fixed light source Scape).The compression method is realized using DirectCompute, make use of its computation capability quickly to calculate.
Preferably, the packaging method that shade is calculated in step (3) is as follows:
Screen pixels are packed according to 2 × 2 pixel regions, and the shadow result of 4 pixels in each bag is painted same Calculated in streamline processed.
Because scene geometry has continuity spatially, the corresponding triangle that blocks of adjacent screen pixels also has very big Probability is same triangle or the triangle of side adjoining each other.The present invention proposes a kind of shade computational methods based on packing.
According to 4 pixels light source space projection coordinate, when the triangle that uniformity test is related to has repetition situation During generation, the geometry read operation of redundancy can be avoided.
Preferably, detailed process is in step (3):
For each screen pixels successively using in corresponding central shielding triangle, side adjoining triangle and adjacent pixel Triangle information representing tested as detection triangle, until acquisition current screen pixel blocks triangle, then hidden with this Keep off the depth value that triangle geometry rebuilds the shelter of current screen pixel;
Relative to current screen pixel during detection, if each component of the barycentric coodinates of the pixel be all located at 0 to 1 it Between, then the detection triangle is that current screen pixel blocks triangle;
If can not detect that obtain current screen pixel blocks triangle in detection triangle, estimated using extrapolation method Meter obtains the depth value of the shelter of current screen pixel.
For some pixels, situation about can not pass through can occur for consistency detection, that is, the triangle detected is not The true of the pixel blocks triangle.Its basic reason is that triangle geometry storage is the discrete storage based on rasterisation, is caused The original geometry of scene can only be partly stored in geometrical shadow figure.The present invention is blocked using efficient extrapolation method to pixel The depth value of thing is estimated.
Shade in step (4) is calculated as follows:
For each screen pixels, the ratio of the z coordinate of its light source space and the shelter z values reconstructed according to echo Whether relatively result, it is shade to determine pixel.According to pixel P ' two-dimensional projection's coordinate (P ' .x, P ' .y), it is relative to geometry Triangle T in echo '0Barycentric coodinates (u, v, w) can by equation below calculate obtain.
The depth P of shelterocc.z it can be obtained by linear interpolation.
Pocc.z=uV0.z+v·V1.z+w·V2.z
In formula:
(P ' .x, P ' .y) is expressed as pixel P ' two-dimensional projection's coordinate,
(u, v, w) be expressed as its relative to the triangle T in geometrical shadow figure '0Barycentric coodinates,
(V0.x, V0.y), (V1.x, V1) and (V .y2.x, V2.y) the xy coordinates on three summits of triangle are blocked in expression,
Z represents depth value.
Calculate Pocc.z and with P ' .z compared, it may be determined that the shade result of calculation of P points:If the former is less than the latter, Illustrate that P points are blocked, it is on the contrary then be to illuminate.
Beneficial effects of the present invention:
The present invention solves the problems, such as shade drawing method losing shape and depth migration inherently, also improves the shade of RGSM methods Quality and method performance, while also taking conservative rasterisation, the storage of side adjoining triangle, adjacent pixel lookup and linear extrapolation The problem of alleviating wrong shade caused by geological information is lacked etc. method, makes the number of pixels that shade calculates mistake drop to most It is low;In addition a choosing for rebuilding geometrical shadow figure is used as present invention also adds a kind of geometry cache compression method based on GPU , the precomputation that it can be compressed in the scene that light source is fixed to geological information data, the storage needed for reduction method is empty Between, the continuity based on neighboring screens pixel shelter;The invention also provides the method that a kind of packing of shade is calculated, reduce The expense of geometry cache is read, method performance is improved.
Brief description of the drawings
Fig. 1 is the basic procedure schematic diagram of the embodiment of the present invention;
Fig. 2 projects to schematic diagram on geometrical shadow figure for the light source space triangle of the embodiment of the present invention;
Fig. 3 is the conservative grating method principle and its example schematic of the embodiment of the present invention;
Fig. 4 is the schematic flow sheet of the geometrical shadow figure compression method of the embodiment of the present invention;
Fig. 5 calculates schematic diagram for the shade based on packing of the embodiment of the present invention;
Fig. 6 is found using distinct methods for the sampled point of the embodiment of the present invention and truly blocks triangle schematic diagram.
Embodiment
As shown in figure 1, the technical solution adopted by the present invention is:The geometrical shadow drawing method that a kind of triangle is rebuild, in fact Apply step as follows:
1) scene is drawn in light source space, generates and store geometrical shadow figure;
In the geometric coloration stage of rendering pipeline, the function of conservative rasterisation is added, the screening of each pixel is preserved Triangle is kept off, and this blocks three sides adjoining triangle of triangle;
Geometrical shadow figure storage triangle information representing is substantially that traditional shade drawing method is instead of with continuous original geometry In discrete sampling depth information.Because geometrical shadow figure is the geological information based on rasterisation generation, it is for whole field It is still incomplete for scape, it can cause partial pixel can not find corresponding shelter geometry in echo.In order to This point is compensated, the present invention not only stores its triangle that blocks for each pixel, can also store block triangle three Side abuts triangle.Geometry colouring function directly supports the topological relation that triangle edges are abutted in current main-stream hardware, efficiently Obtain the geometry that side abuts triangle.As shown in Fig. 2 a pixel for geometrical shadow figure stores six vertex datas: Central shielding triangle T0Three summits, side adjoining triangle T1、T2And T3Other three summits being related to.
In geometrical shadow figure, the x and y coordinates of triangular apex are stored as 16-bit forms, and z coordinate is stored as 32-bit Form ensures the precision of depth value.
Due to the limited resolution of geometrical shadow figure, the triangle of some projected areas " small " or " elongated ", which can not be covered, appoints What pixel center, it is difficult to be stored in geometrical shadow figure, example P that such as Fig. 3 (b) is partly provided is corresponding to block triangle It is shown.And for the pixel near shadow outline line, its corresponding triangle that blocks can only have the screening of small area in some pixels Gear, and such block information will also tend to lose, as shown in the corresponding regions of example Q that Fig. 3 b are provided.In order to record these The triangle or delta-shaped region of loss, the present invention carried out estimation using conservative rasterisation to the overlay area of triangle, made It is recorded in geometrical shadow figure as much as possible.As shown in Fig. 3 (a) part, the estimation region of crossing of inside triangle is void Triangle and the common factor of Rectangular Bounding Volume that line is represented.This step only needs to handle i.e. triangle in geometric coloration Can, do not change the overall flow of method.
2) to step 1) obtained geometrical shadow figure is compressed to reduce the superfluous of geometrical shadow figure intermediate cam shape based on GPU It is remaining, the geometrical shadow figure after being compressed;
A depth value, the triangle geometry of the inventive method storage are stored relative to each pixel of traditional shade drawing method Need more memory spaces.In fact, the triangle that blocks that adjacent pixel is stored in geometrical shadow figure is probably same three Angular, it means that to there is bulk redundancy in the geometric data of storage, the space of geometrical shadow figure can be compressed.Therefore originally Inventive method provides One function option, and user can select the precomputation being compressed to geometrical shadow figure, reduce method Storage overhead and run time.The function is particularly suitable for use in the scene of fixed light source.The compression method is used DirectCompute is realized, make use of its computation capability quickly to calculate, and the master of compression is illustrated by Fig. 4 example Want step:
(a) the sequence number figure of a dough sheet is generated while generating geometrical shadow figure, and records each texel in geometry Original position in echo.The information can also directly be obtained by the geometric coloration of rendering pipeline.Such as Fig. 4 (a) Shown in part, the problem equivalent from ordered series of numbers the problem of repetition numeral is removed.
(b) double tune merger sequences are carried out to sequence number according to the sequence number figure of dough sheet, then extracts sequence number using parallel algorithm In non-duplicate sequence number, while make positional information it is synchronous with serial number information change.The process needs log2N iteration, n is pixel Total number.For ith iteration, each thread process 2iNon-repetitive sequence number is simultaneously stored in the fragment by individual sequence number fragment Duan Shouwei is put.By taking Fig. 4 (b) part as an example, 4 non-repetitive sequence numbers have been extracted out, save as the dough sheet sequence number of compression Figure.
(c) original positional information is reused after sorting new sequence number figure is obtained to the sequence number progress order recovery of dough sheet.Cause Change is had occurred that for the numeric order and original numeric order in the dough sheet sequence number figure of compression, the dough sheet according to the compression The geometrical shadow figure of sequence number figure generation compression can cause occur substantial amounts of random data access, drop in follow-up shade calculation procedure The performance of low method.As shown in Fig. 4 (c) part, the original order for recovering four sequence numbers is necessary.Accordingly, it would be desirable to record Original position of each pixel in geometrical shadow figure, and in the sequence and iterative process of step (1) down, make positional information with Serial number information synchronously changes, and reuses positional information and carries out order recovery to sequence number.
(d) as shown in Fig. 4 (d) part, a read-write texture is created according to new sequence number figure, corresponding dough sheet is non- Redundancy geological information writes wherein, and generates the index map of geometrical shadow figure size, index map as compression method another The corresponding storage location for blocking triangle in compression geometrical shadow figure of in store each pixel, guiding in output, index map The read operation of follow-up triangle geometry information.
3) scene is drawn in ken space, pixel is packed according to 2 × 2 pixel regions, then carry out triangle uniformity Check, the depth value of pixel shelter is rebuild with the triangle geometry of storage;
Because scene geometry has continuity spatially, the corresponding triangle that blocks of adjacent screen pixels also has very big Probability is same triangle or the triangle of side adjoining each other.This contributes to the inventive method to reduce three repeated in computational shadowgraph The memory access expense of angular geometry, improves method efficiency.
As shown in figure 5, the present invention proposes a kind of shade computational methods based on packing.Screen pixels are according to 2 × 2 pixels Region is packed, and the shadow result of 4 pixels in each bag is calculated in same rendering pipeline.According to 4 pictures The plain projection coordinate in light source space, when the triangle that uniformity test is related to has the generation of repetition situation, the geometry of redundancy Read operation can be avoided.According to the experimental result of the present invention, the packing of 2 × 2 pixels is most effective for the lifting of method performance Really, pixel can excessively reduce the concurrency of method in wrapping.
For each pixel, method needs that correctly finds it in geometrical shadow figure to block triangle, this process Referred to as triangle consistency detection;Respectively using the triangle information representing blocked in triangle, side adjoining triangle and adjacent pixel Tested, find the original triangle geometry for blocking pixel;The standard that the detection passes through is the every of barycentric coodinates (u, v, w) Individual component is all located between 0 to 1.
For some pixels, situation about can not pass through can occur for consistency detection, that is, the triangle detected is not The true of the pixel blocks triangle.Its basic reason is that the triangle geometry storage of method is that discrete based on rasterisation is deposited Storage, causing the original geometry of scene can only partly be stored in geometrical shadow figure.
As shown in Fig. 6 (a) part, T '0With T '1It is two triangles stored in geometrical shadow figure.Pixel P0Project to In pixel A, the triangle T stored in pixel A '1P can not be made0Pass through consistency detection, pixel P1There is also it is similar the problem of. And method of the present invention stores the side adjoining triangle for blocking triangle, therefore this problem can be solved preferably Certainly.When in pixel block triangle can not be by uniformity test when, may proceed to test this and block three side neighbours of triangle Connect triangle and actual block triangle to find.
But abut triangle information representing even with side, it is impossible to still can exist by the pixel of consistency check.Such as Shown in Fig. 6 (b) part, the triangle stored in pixel C is T '2With its side adjoining triangle T '4、T′5.But for pixel P2For, its triangle that actually blocks is T '3.Therefore the present invention is continued with from P2Other nearest three pixel internal storage storages Triangle information representing, i.e. pixel D, E and F further increase the chance for finding correct triangle.The above method being capable of maximum journey Degree ground make pixel find it is respective block triangle, so as to generate high-quality shade.
Because the triangle number stored in geometrical shadow figure is limited, can always exist can not be by the picture of consistency check Element, thus the present invention consider a kind of efficient method of estimation is taken to estimate their shelter depth value.In this case, The present invention is illustrated by taking Fig. 6 (c) part as an example.
T0、T1、T2And T3It is stored in four triangles in geometrical shadow figure some pixel.P is a nothing in the pixel Method is by the screen pixels of consistency check, and it is relative to TiCentre coordinate be (ui, vi, ωi).Then can be according to these Barycentric coodinates determine which shadow region that P is located near triangle.Due to u0< 0 and v0< 0, then shadow region located above P In domain, T is selected0、T2、T3To estimate P shelter depth.For T0、T2、T3Each triangle, can extrapolation go out P's Depth value, then takes the average value of three extrapolation depth to be used as P shelter depth.
For being the multilayer triangle in the case of of blocking in pixel, i.e., two triangles without syntople, which have all been blocked, works as A part for preceding pixel, the processing of the inventive method is searches by adjacent pixels, by searching the triangle that adjacent pixels are stored Shape and its syntople, can greatly increase and search the true possibility for blocking triangle;For still search for less than situation, it is deep Insert method of being outside one's consideration can approx estimate corresponding depth value.Although it has error, this line relative to real depth value Property estimation method be better than the arest neighbors sampled value of traditional shade drawing method in theory.
4) compare the pixel depth and step 3 of light source space) shelter depth value, obtain shade result of calculation, it is complete Into the reconstruction of geometrical shadow figure.
For each pixel, the comparison knot of the z coordinate of its light source space and the shelter z values reconstructed according to echo Really, whether determine pixel is shade.According to pixel P ' two-dimensional projection's coordinate (P ' .x, P ' .y), its relative to triangle T '0 Barycentric coodinates (u, v, w) can by equation below calculate obtain.
The depth P of shelterocc.z it can be obtained by linear interpolation.
Pocc.z=uV0.z+v·V1.z+w·V2.z
In formula:
(P ' .x, P ' .y) is expressed as pixel P ' two-dimensional projection's coordinate,
(u, v, w) be expressed as its relative to the triangle T in geometrical shadow figure '0Barycentric coodinates,
(V0.x, V0.y), (V1.x, V1) and (V .y2.x, V2.y) the xy coordinates on three summits of triangle are blocked in expression,
Z represents depth value.
Calculate Pocc.z and with P ' .z compared, it may be determined that the shade result of calculation of P points:If the former is less than the latter, Illustrate that P points are blocked, it is on the contrary then be to illuminate.

Claims (5)

1. the geometrical shadow drawing method that a kind of triangle is rebuild, it is characterised in that including:
(1) scene is drawn in light source space, generates and store geometrical shadow figure;
In the geometric coloration stage of rendering pipeline, the operation of conservative rasterisation is added, preserve each pixel blocks three It is angular, and this block triangle three sides adjoining triangle;
(2) the geometrical shadow figure that step (1) is obtained is compressed based on GPU to reduce the superfluous of geometrical shadow figure intermediate cam shape It is remaining, the index map of geometrical shadow figure and geometrical shadow figure size after being compressed;The compression of geometrical shadow figure is as follows:
(a) the sequence number figure of a dough sheet is generated while generating geometrical shadow figure, and records each texel in geometrical shadow Original position in figure;
(b) double tune merger sequences are carried out to sequence number according to the sequence number figure of dough sheet, then extracted using parallel algorithm in sequence number Non-duplicate sequence number, while making the positional information change synchronous with serial number information of correspondence texel;
(c) original positional information is reused after sorting new sequence number figure is obtained to the sequence number progress order recovery of dough sheet;
(d) a read-write texture is created according to new sequence number figure, the geological information of nonredundancy in corresponding dough sheet is write it In, and generate the geometrical shadow figure after described compression and the index map of geometrical shadow figure size;
(3) scene is drawn in ken space, pixel is packed according to 2 × 2 pixel regions, then carry out triangle uniformity inspection Look into, according to inspection result, current screen pixel is rebuild accordingly with the triangle geometry stored in the geometrical shadow figure after compression Shelter depth value;
(4) compare the depth value of the pixel depth of light source space and the shelter of step (3), shade result of calculation is determined, with complete Into the reconstruction of geometrical shadow figure.
2. the geometrical shadow drawing method that triangle according to claim 1 is rebuild, it is characterised in that carried out in step (1) During conservative rasterisation, the pixel region covered to blocking triangle carried out estimation, and by estimated result record in geometry In echo.
3. the geometrical shadow drawing method that triangle according to claim 1 is rebuild, it is characterised in that the geometrical shadow figure Each pixel correspondence store six vertex datas, including:Three summits of central shielding triangle and three side adjoinings three Angular other three summits being related to.
4. the geometrical shadow drawing method that triangle according to claim 1 is rebuild, it is characterised in that:Shade in step (3) The packaging method of calculating is as follows:
Screen pixels are packed according to 2 × 2 pixel regions, and the shadow result of 4 pixels in each bag draws stream same Calculated in waterline.
5. the geometrical shadow drawing method that triangle according to claim 1 is rebuild, it is characterised in that:It is specific in step (3) Process is:
For each screen pixels successively using three in corresponding central shielding triangle, side adjoining triangle and adjacent pixel Angular information is tested as detection triangle, blocks triangle until acquisition current screen pixel, then block three with this The depth value of the shelter of angular geometrical reconstruction current screen pixel;
Relative to current screen pixel during detection, if each component of the barycentric coodinates of the pixel is all located between 0 to 1, The detection triangle is that current screen pixel blocks triangle;
If can not detect that obtain current screen pixel blocks triangle in detection triangle, estimated using extrapolation method To the depth value of the shelter of current screen pixel.
CN201510320994.XA 2015-06-12 2015-06-12 The geometrical shadow drawing method that triangle is rebuild Active CN104966313B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510320994.XA CN104966313B (en) 2015-06-12 2015-06-12 The geometrical shadow drawing method that triangle is rebuild

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510320994.XA CN104966313B (en) 2015-06-12 2015-06-12 The geometrical shadow drawing method that triangle is rebuild

Publications (2)

Publication Number Publication Date
CN104966313A CN104966313A (en) 2015-10-07
CN104966313B true CN104966313B (en) 2017-09-19

Family

ID=54220344

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510320994.XA Active CN104966313B (en) 2015-06-12 2015-06-12 The geometrical shadow drawing method that triangle is rebuild

Country Status (1)

Country Link
CN (1) CN104966313B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106251746B (en) * 2016-08-22 2022-04-29 杭州澳宇自动化设备有限公司 Portable photovoltaic power plant analog instrument operation control system
CN106846455B (en) * 2017-01-10 2020-12-15 努比亚技术有限公司 Dynamic shadow processing terminal and method
WO2020019133A1 (en) * 2018-07-23 2020-01-30 太平洋未来科技(深圳)有限公司 Method and device for determining shadow effect and electronic device
CN109712211B (en) * 2018-12-21 2023-02-10 西安恒歌数码科技有限责任公司 Efficient body shadow generation method based on OSG

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271588A (en) * 2007-10-26 2008-09-24 威盛电子股份有限公司 Recreatable geometric shade pattern method
CN102651137A (en) * 2012-04-01 2012-08-29 浙江大学 Algebraic curve rasterization method based on pixel precision
CN102750131A (en) * 2012-06-07 2012-10-24 中国科学院计算机网络信息中心 Graphics processing unit (GPU) oriented bitonic merge sort method
CN102831634A (en) * 2012-08-16 2012-12-19 北京航空航天大学 Efficient accurate general soft shadow generation method
CN103810756A (en) * 2014-01-17 2014-05-21 浙江大学 Adaptive Loop subdivision surface drawing method based on irregular region

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8471853B2 (en) * 2007-10-26 2013-06-25 Via Technologies, Inc. Reconstructable geometry shadow mapping method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271588A (en) * 2007-10-26 2008-09-24 威盛电子股份有限公司 Recreatable geometric shade pattern method
CN102651137A (en) * 2012-04-01 2012-08-29 浙江大学 Algebraic curve rasterization method based on pixel precision
CN102750131A (en) * 2012-06-07 2012-10-24 中国科学院计算机网络信息中心 Graphics processing unit (GPU) oriented bitonic merge sort method
CN102831634A (en) * 2012-08-16 2012-12-19 北京航空航天大学 Efficient accurate general soft shadow generation method
CN103810756A (en) * 2014-01-17 2014-05-21 浙江大学 Adaptive Loop subdivision surface drawing method based on irregular region

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
GPU在实时阴影绘制中的应用;刘双 等;《计算机技术与发展》;20091110;第226-229页 *
Sub-Pixel Anti-Aliasing Via Triangle-Based Geometry Reconstruction;Wenjun Du 等;《Computer Graphics Forum》;20141031;第81-90页 *
Sub-Pixel Shadow Mapping;Pascal Lecocq 等;《Interactive 3D Graphics and Games》;20140131;正文第1-8页 *
三维数据场的三维重建与模型的虚拟切割研究;朱经纬;《中国博士学位论文全文数据库 信息科技辑》;20090515;正文第19页第2段、2.3节第1段 *
深度剥离与GPU结合的近似软影算法;孙明彦 等;《中国图象图形学报》;20100916;第1391-1397页 *

Also Published As

Publication number Publication date
CN104966313A (en) 2015-10-07

Similar Documents

Publication Publication Date Title
KR101482578B1 (en) Multi-view ray tracing using edge detection and shader reuse
Staten et al. BMSweep: locating interior nodes during sweeping
US7561156B2 (en) Adaptive quadtree-based scalable surface rendering
CN104966313B (en) The geometrical shadow drawing method that triangle is rebuild
CN103500463B (en) The method for visualizing that on a kind of GPU, multilayer shape facility merges
CN111145356B (en) Cutting method based on Unity3D model
Lecocq et al. Sub-pixel shadow mapping
CN104952102A (en) Deferred shading-orientated uniform anti-aliasing method
TWI417808B (en) Reconstructable geometry shadow mapping method
Wilson et al. Simplifying complex environments using incremental textured depth meshes
US20120287132A1 (en) Method for reconstructing geometry mapping
Chen et al. Depth-presorted triangle lists
Hanniel et al. Direct rendering of solid CAD models on the GPU
US6518964B1 (en) Apparatus, system, and method for simplifying annotations on a geometric surface
Szirmay‐Kalos et al. Specular effects on the gpu: State of the art
Yous et al. Gpu-based shape from silhouettes
Yang et al. Efficient simplification of large vector maps rendered onto 3D landscapes
KR101086228B1 (en) Method and apparatus for providing 3d model cutting simulation
CN104966297B (en) A kind of method that general echo generates shade
Kuder et al. Point-based rendering optimization with textured meshes for fast LiDAR visualization
Goradia et al. Gpu-based ray tracing of splats
Ripolles et al. Rendering continuous level-of-detail meshes by masking strips
Umenhoffer et al. Caustic triangles on the GPU
Di Koa et al. Interactive screenspace fragment rendering for direct illumination from area lights using gradient aware subdivision and radial basis function interpolation
Linsen et al. Smoothviz: Visualization of smoothed particles hydrodynamics data

Legal Events

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