CN104952103A - Viewpoint-dependent shadow map creating method - Google Patents

Viewpoint-dependent shadow map creating method Download PDF

Info

Publication number
CN104952103A
CN104952103A CN201510255989.5A CN201510255989A CN104952103A CN 104952103 A CN104952103 A CN 104952103A CN 201510255989 A CN201510255989 A CN 201510255989A CN 104952103 A CN104952103 A CN 104952103A
Authority
CN
China
Prior art keywords
shadow
space
shadow map
vertebra
viewpoint
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
CN201510255989.5A
Other languages
Chinese (zh)
Other versions
CN104952103B (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.)
PLA University of Science and Technology
Original Assignee
PLA University of Science and Technology
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 PLA University of Science and Technology filed Critical PLA University of Science and Technology
Priority to CN201510255989.5A priority Critical patent/CN104952103B/en
Publication of CN104952103A publication Critical patent/CN104952103A/en
Application granted granted Critical
Publication of CN104952103B publication Critical patent/CN104952103B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Generation (AREA)

Abstract

The invention discloses a viewpoint-dependent shadow map creating method. A view frustum is clipped to obtain a shadow visible space, and then shadow maps are created on the basis of the shadow visible space. The viewpoint-dependent shadow map creating method includes particular steps of (1), clipping the view frustum: deleting non-shadow spaces of view frustum portions to form a clipped strict shadow surrounding space called as the shadow visible space which is the minimum space for generating the shadow maps; (2), generating the shadow maps: generating light ray frustums, segmenting the shadow visible space and rendering objects in the light ray frustums by the aid of shadow cameras to obtain the shadow maps. The viewpoint-dependent shadow map creating method has the advantages that the non-shadow spaces are eliminated, and accordingly the problem of overlapping of spaces between existing shadow maps can be solved; the shadow maps are assuredly matched with resolution of screen pixels by the aid of a bidirectional segmentation algorithm; the non-shadow spaces are removed by the aid of a process for clipping the view frustum, and accordingly the space utilization rate of the shadow maps can be greatly increased.

Description

The shadow map creation method that a kind of viewpoint relies on
Technical field
The invention belongs to computer graphics techniques field, particularly the shadow map creation method that relies on of a kind of viewpoint.
Background technology
Shade is very important visual signature, and shade gives the information of whether light source position in scene, highlights the spatial relationship between object.Therefore, Shading Rendering is a hot issue in computer graphics, and the sense of reality especially strengthening virtual scene in 3d gaming and animation seems particularly important.These years, Many researchers has proposed the problem that a lot of method solves real-time rendering.Shadow map algorithm (shadow mapping) is widely used as the effective Shading Rendering algorithm of one.Standard shadow pinup picture is the algorithm based on image, so when the lack of resolution of shadow map, traditional shadow map algorithm generates shade can cause crenellated phenomena.Traditional shadow map algorithm cuts vertebra by thresholding method division view and creates shadow map, and non-shadow space can occupy ratio greatly in shadow map, and this is the reason causing the resolution of shadow map to reduce.The reason that another one causes the resolution of shadow map to reduce is the space overlap between shadow map.
Shadow map algorithm has simplicity and high-level efficiency, Stamminger in 2002 at " Perspective shadow maps. ", Martin is that 2004 in " Anti-aliasing and continuity with trapezoidal shadow maps. ", by specifying truncated cone to be converted in light source space establishment shadow map, these method Problems existing are: only have a shadow map cannot mate the resolution of a large scene.Fan Zhang, Hanqiu Sun, Leilei Xu, Lee Kit Lun proposed a kind of PSSMs (parallel separation shadow map) algorithm in 2006 in " Parallel-split shadow maps for large-scale virtual environments ", Rouslan Dimitrov proposed a kind of CSM (lamination shadow map) algorithm in 2008 at " Cascaded Shadow Maps ", these two kinds of methods all belong to thresholding method, there is the problem because space overlap between shadow map causes shade quality to reduce.Andrew Lauritzen, Marco Salvi, and Aaron Lefohn proposes a kind of auto-partition algorithm by analyzing light source space depth profile in 2011 in " Sample distribution shadow maps. ", compared with first two algorithm, this algorithm improves the utilization factor that shadow map gets rid of empty shade, but the problem of this method still Existential Space overlap, for the scene being full of shadow object of complexity, the method is very limited to the improvement of quality.In a word, traditional scene relies on the method creating shadow map cuts vertebra to view separation based on thresholding method, and these methods have advantage in the shade sample of space distribution, but fails to solve the low problem of the overlapping resolution caused.It is limited to two aspects improving shade quality: 1, space overlap: it is cut the AABB bounding box of vertebra by view or encircle sphere generates that light cuts vertebra, the space overlap that light cuts vertebra is inevitable, because space overlap causes the resolution of shadow map to reduce; 2, non-shadow space: non-shadow space comprises space space under surface level and surface level not comprising shade object, these non-shadow spaces are useless for Shading Rendering, but they still can occupy a big chunk ratio of shadow map, the space availability ratio of shadow map is caused seriously to reduce.
Summary of the invention
The object of this invention is to provide the shadow map creation method that a kind of viewpoint relies on, non-shadow space proportion be large to solve, the problem of space overlap between shadow map.
For achieving the above object, the technical solution used in the present invention is:
The shadow map creation method that viewpoint relies on, first view being cut vertebra is accurately a shade visibility region, then creates shadow map based on this shade visibility region.
Its concrete steps are:
(1), view cuts vertebra cutting
Non-shadow space view being cut vertebra part is deleted, thus forms the shadow object on a stricter border, and by the space called after shade visibility region after this cutting, it is the minimum space for generating shadow map;
(2), shadow map generates
First generate light and cut vertebra, then by the above-mentioned shade real space of segmentation, generate shadow view.
The space comprising and being positioned at without projected objects on space under surface level and surface level is deleted in described non-shadow space.
Adopt two-way partitioning algorithm to divide view field, cut vertebra according to these partition creating light successively.
The viewport that light cuts vertebra is determined by its respective partition, and the viewport that light cuts vertebra determines again the viewport of shadow map.
Cut vertebra for light, its far away and hither plane should be determined by all shadow objects comprised inside its ken.
Light cuts after vertebra determines, object that light cuts in vertebra generates shadow map to utilize shade camera to play up.
The invention has the beneficial effects as follows: the present invention cuts vertebra by cutting view and obtains shade real space, the projection in ray space for shade real space is split, and utilizes segmentation result to create shadow map.By method of the present invention, eliminate non-shadow space, solve the problem of the space overlap between shadow map; The distribution of echo coupling screen pixels is guaranteed by two-way partitioning algorithm; Adopt view to cut vertebra method of cutting out and remove non-shadow space, which greatly enhances the space availability ratio of shadow map; Compared with classic method, the shadow map created by method of the present invention has higher resolution, shade can under any visual angle seamless rendering.Shade shake is can't see in viewpoint moving process.In addition, method of the present invention realizes comparatively easy, can be applied to other programs.
Accompanying drawing explanation
Fig. 1 is that view cuts in vertebra the schematic diagram deleting non-shadow space;
Fig. 2 creates based on subregion the schematic diagram that light cuts vertebra on light projection plane;
Fig. 3 is the schematic diagram of view field longitudinal (left side) and horizontal (right side) subregion;
Fig. 4 is for when observer is closely surperficial, and the present invention (left side) presents quality versus with the shade of CSM (right side) and schemes;
Fig. 5 is for when observer is closely surperficial, and the present invention (left side) presents Detail contrast figure with the shade of CSM (right side);
Fig. 6 is when observer is remotely surperficial, the present invention (left side) and the shade precision of CSM (right side) and the comparison diagram of seam.
Embodiment
Below in conjunction with accompanying drawing, the present invention is further described.
Traditional shadow map algorithm can not reduce the problem of space overlap, because the mode that they rely on scene creates shadow map, when creating shadow map, first whole view is cut vertebra and separates by these methods, then cuts vertebra segmentation section establishment light by these views and cuts vertebra.By classic method, the viewport of shadow map cuts vertebra by light and determines, the resolution increase of shadow map is limited to thresholding method.
The present invention proposes the shadow map establishment algorithm solution space overlap problem that a kind of viewpoint relies on, to improve shade quality, in the method for the invention, first view is cut vertebra and be cut to a shade visibility region, then create shadow map based on this shade visibility region.
The shadow map creation method that viewpoint of the present invention relies on comprises the steps:
(1), view cuts vertebra cutting
Non-shadow space view being cut vertebra part is deleted, and the space comprising and being positioned at without projected objects on space under surface level and surface level is deleted in non-shadow space;
As shown in Figure 1, non-shadow space comprises the space without projected objects on space under surface level and surface level, these spaces are useless for Shading Rendering, they should be cut vertebra from view and crop, thus form a shade bounding box more closely, by the space called after shade real space after this cutting, it is the minimum space for generating shadow map.
(2), shadow map generates
First generate light and cut vertebra, utilize light to cut vertebra by the above-mentioned shade visibility region of segmentation, generate shadow view.
Shade real space after refinement is no longer a common truncated cone, and traditional view cuts vertebra partition method can not be used for this erose space of subregion, therefore needs a new method to split above-mentioned shade visibility region.
For realizing splitting above-mentioned shade real space, we have proposed the dividing method that a viewpoint relies on, in this method, needing the concept introducing light projection plane to understand the method.
Ray cast plane is any one plane vertical with light, and shade real space projects in this plane, defines the border of a view field in ray cast plane; Only have object to be positioned at the view field of ray space, its depth value just can be played up shadow map.
As shown in Figure 2, view field is divided into multiple subregion, adopts two-way partitioning algorithm to divide view field, cuts vertebra successively according to these partition creating light.The viewport that light cuts vertebra is determined by its respective partition, and therefore the viewport of shadow map is also determined by its corresponding subregion.Cut vertebra for light, its far away and hither plane should be determined by all shadow objects comprised inside its ken.Light cuts after vertebra determines, object that light cuts in vertebra generates shadow map to utilize shade camera to play up.
Light cuts the segmentation that vertebra can be regarded as shade real space, and its viewport size is relevant to the distance of viewpoint according to them, avoids light and cuts space overlap problem between vertebra.
Compared with classic method, the shadow map created by method of the present invention has the resolution of more mating with screen pixels.
The size of all shadow maps can be set to identical value, in this embodiment, is set to 2048 × 2048.
Introduce the method for view field's subregion below in detail:
By two-way partitioning algorithm, for each shade camera creates a suitable viewport.
As shown in Figure 3, by this algorithm, view field is in first longitudinally segmentation, and then horizontal partition.
As Fig. 3, view field is simply regarded as one symmetrical trapezoidal, before detailed description, need to define some symbols for discussion below.
θ (θ ∈ [0, pi/2)) be observe angle that is square and a view field limit, its value changes along with the position of observer;
N is the length of the near side (ns) of view field, and f is the length of its distal edge;
L is the length of view field;
S ifor the subregion of view field, for a subregion S i(i > 1), its vertical and horizontal sides is W respectively iand H i;
ρ is the space waste factor of each subregion, and what its representative was positioned at partition space outside view field divides ratio into whole.
Longitudinally segmentation:
When view field carry out longitudinal direction split time, the farthest wasting space of each subregion of restriction;
ζ represents in each subregion the maximum space factor allowing to waste, ρ≤ζ. the length of side of each subregion is geometric series change,
In this case, corresponding echo precision can not flip-flop, increment coefficient σ by shown in equation (1),
σ = 1 1 - 2 · t a n θ θ ∈ [ 0 , arctan ζ ) 1 1 - 2 ζ θ ∈ [ arctan ζ , π / 2 ) - - - ( 1 )
Subregion S ithe length on two limits is:
W i = σ i · n H i = σ i · n θ ∈ [ 0 , arctan ζ ) σ i . ζ t a n θ · n θ ∈ [ arctan ζ , π / 2 ) - - - ( 2 )
Equation (2) can calculate the length of side of each subregion, and it can prove out that the wasting space in each subregion is not more than ζ easily.
N hbe longitudinal partition number, it should meet the following requirements:
Σ i = 1 N H H i ≥ L - - - ( 3 )
N hthe dynamic change along with observer's variation, this guarantees that shadow map creates in a dynamic way.For saving internal memory, improving rendering efficiency, at utmost limiting vertical partition quantity, N h≤ N hmax(in the present embodiment, N hmax=4),
For subregion its length of side is calculated as:
W N H = f H N H = L N H = 1 L - Σ i = 1 N H - 1 H i N H > 1 - - - ( 4 )
In practice, size may be greater than other subregions, its wasting space may more than ζ.
But, because away from observer, only account for the screen space of very small scale.Even if the lack of resolution of shadow map, also can not have a negative impact to shade quality.
Horizontal partition:
For shadow map, the difference of its uv resolution should be limited to a certain limit ε,
This restriction is necessary, because can ensure that shade can all have higher resolution factor in uv direction, by longitudinal segmentation, meets this restriction.
According to longitudinal splitting scheme, for each region S i, W ibe not less than H i.
In this case, only need horizontal partition, as shown in Fig. 3 bottom right.
Horizontal partition N wcorrespond to S i, calculate
N wconditional, in the present embodiment, N w≤ 2.The rationality of this restriction is proved by revision test.
Behind horizontal partition, the length of side W of each below subregion ijbe calculated as
In order to show advantage of the present invention, contrast with CSM (cascade shadow map) algorithm.
In present embodiment, allow maximum space factor ζ=0.3 wasted in each subregion, the variation limits ε of resolution uv is 0.5.
The view of CSM cuts vertebra and is divided into 4 parts, and enables PCF Gaussian blurring function,
As shown in Figures 4 and 5, the present invention is compared with classic method, and when observer is closely surperficial, method of the present invention shows more shadow detail.
As Fig. 6, when observer is remotely surperficial, method of the present invention also can keep high shade quality, and without any shade seam.
VSM of the present invention can be implemented in observer and rocks middle shade non-jitter.
In addition, efficiency of the present invention is very high, and at our computer accessory Core I7 CPU, when 8G memory, and GTX 780 GPU, average frame rate is about 90fps.
The present invention projects ray cast plane first by shade real space, and the algorithm then utilizing viewpoint to rely on carries out two-way segmentation to view field, and the viewport of shadow map is determined by these subregions; Then, vertebra is cut based on these partition creating light.In this case, light cuts the viewport of vertebra by the decision of projection subregion.Compared with classic method, method of the present invention creates shadow map by contrary order:
Shadow map creates based on the projection localization region of shade real space, solves the problem in space overlap and non-shadow space; For solving the problem in non-shadow space, view being cut vertebra and being cut to shade real space; In order to solve the problem of space overlap, shade real space is projected to ray cast plane, and the algorithm that viewpoint relies on according to viewpoint is carried out to view field split.
The above is only the preferred embodiment of the present invention; be noted that for those skilled in the art; under the premise without departing from the principles of the invention, can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (8)

1. a shadow map creation method for viewpoint dependence, is characterized in that: first view is cut vertebra and be cut to a shade real space, then create shadow map based on this shade real space.
2. the shadow map creation method of viewpoint dependence as claimed in claim 1, is characterized in that: its concrete steps are:
(1), view cuts vertebra cutting
Non-shadow space view being cut vertebra part is deleted, thus forms a shadow object bounding box more closely, and by the space called after shade real space after this cutting, it is the minimum space for generating shadow map;
(2), shadow map generates
First generate light and cut vertebra, light cuts vertebra and achieves segmentation to shade visibility region,
Utilize light to cut vertebra and generate echo.
3. the shadow map creation method that relies on of viewpoint as claimed in claim 2, is characterized in that: the space comprising and being positioned at without projected objects on space under surface level and surface level is deleted in described non-shadow space.
4. the shadow map creation method of viewpoint dependence as claimed in claim 2, is characterized in that: adopt two-way partitioning algorithm to divide view field, cut vertebra successively according to these partition creating light.
5. the shadow map creation method of viewpoint dependence as claimed in claim 2, is characterized in that: the viewport that light cuts vertebra is determined by its respective partition, so the viewport of shadow map is also determined by its corresponding subregion.
6. the shadow map creation method that relies on of viewpoint as claimed in claim 2, is characterized in that: cut vertebra for light, and its far away and hither plane should be determined by all shadow objects comprised inside its ken.
7. the shadow map creation method that relies on of viewpoint as claimed in claim 2, is characterized in that: light cuts after vertebra determines, object that light cuts in vertebra obtains shadow map to utilize shade camera to play up.
8. the shadow map creation method of viewpoint dependence as claimed in claim 4, is characterized in that: described two-way partitioning algorithm comprises
Longitudinally segmentation: longitudinal segmentation is carried out to view field, the farthest wasting space of each subregion of restriction;
Horizontal partition: for shadow map, the difference of its resolution uv should be limited to a certain limit ε, by again carrying out horizontal division to vertical partition, meet this restriction.
CN201510255989.5A 2015-05-19 2015-05-19 The shadow map creation method that a kind of viewpoint relies on Expired - Fee Related CN104952103B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510255989.5A CN104952103B (en) 2015-05-19 2015-05-19 The shadow map creation method that a kind of viewpoint relies on

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510255989.5A CN104952103B (en) 2015-05-19 2015-05-19 The shadow map creation method that a kind of viewpoint relies on

Publications (2)

Publication Number Publication Date
CN104952103A true CN104952103A (en) 2015-09-30
CN104952103B CN104952103B (en) 2018-03-09

Family

ID=54166728

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510255989.5A Expired - Fee Related CN104952103B (en) 2015-05-19 2015-05-19 The shadow map creation method that a kind of viewpoint relies on

Country Status (1)

Country Link
CN (1) CN104952103B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106548506A (en) * 2016-10-31 2017-03-29 中国能源建设集团江苏省电力设计院有限公司 A kind of virtual scene Shading Rendering optimized algorithm based on layering VSM
CN111028357A (en) * 2018-10-09 2020-04-17 北京嘀嘀无限科技发展有限公司 Soft shadow processing method and device of augmented reality equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4172954A1 (en) * 2020-06-30 2023-05-03 InterDigital CE Patent Holdings, SAS Shadow-based estimation of 3d lighting parameters from reference object and reference virtual viewpoint

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101393651A (en) * 2008-11-07 2009-03-25 北京航空航天大学 View field driving real-time shadow method
CN102436673A (en) * 2011-10-24 2012-05-02 克拉玛依红有软件有限责任公司 Shadow drafting method of large-scale outdoor scene
CN102903146A (en) * 2012-09-13 2013-01-30 中国科学院自动化研究所 Image processing method for scene drawing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101393651A (en) * 2008-11-07 2009-03-25 北京航空航天大学 View field driving real-time shadow method
CN102436673A (en) * 2011-10-24 2012-05-02 克拉玛依红有软件有限责任公司 Shadow drafting method of large-scale outdoor scene
CN102903146A (en) * 2012-09-13 2013-01-30 中国科学院自动化研究所 Image processing method for scene drawing

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
ZHANG F 等: "Parallel-Split Shadow Maps for Large-scale Virtual Environments", 《VRCIA 2006 ACM INTERNATIONAL COFERENCE ON VIRTUAL REALITY CONTINUUM AND ITS APPLICATIONS》 *
傅雅宁: "《计算机图形学教程第一版》", 31 December 2005, 国防工业出版社 *
孙毅 等: "航天器在轨飞行的实时可视化仿真", 《系统仿真学报》 *
张勇 等: "视景仿真系统中实时阴影绘制技术的研究", 《系统仿真学报》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106548506A (en) * 2016-10-31 2017-03-29 中国能源建设集团江苏省电力设计院有限公司 A kind of virtual scene Shading Rendering optimized algorithm based on layering VSM
CN111028357A (en) * 2018-10-09 2020-04-17 北京嘀嘀无限科技发展有限公司 Soft shadow processing method and device of augmented reality equipment

Also Published As

Publication number Publication date
CN104952103B (en) 2018-03-09

Similar Documents

Publication Publication Date Title
US10984582B2 (en) Smooth draping layer for rendering vector data on complex three dimensional objects
Chaurasia et al. Depth synthesis and local warps for plausible image-based navigation
US9324184B2 (en) Image three-dimensional (3D) modeling
US10229524B2 (en) Apparatus, method and non-transitory computer-readable medium for image processing based on transparency information of a previous frame
CN104331918A (en) Occlusion culling and acceleration method for drawing outdoor ground surface in real time based on depth map
CN112189220B (en) Soft occlusion for computer graphics rendering
CN107220372B (en) A kind of automatic laying method of three-dimensional map line feature annotation
CN104781852A (en) A computer graphics method for rendering three dimensional scenes
US20150138193A1 (en) Method and device for panorama-based inter-viewpoint walkthrough, and machine readable medium
CN104299263A (en) Method for modeling cloud scene based on single image
TWI574237B (en) Three-dimensional map display system
CN102243768A (en) Method for drawing stereo picture of three-dimensional virtual scene
US11113878B2 (en) Screen tile pair-based binocular rendering pipeline process and method
Xu et al. Depth-aided exemplar-based hole filling for DIBR view synthesis
KR101507776B1 (en) methof for rendering outline in three dimesion map
CN104952103A (en) Viewpoint-dependent shadow map creating method
CN104463959A (en) Method for generating cubic environment maps
US9001157B2 (en) Techniques for displaying a selection marquee in stereographic content
KR20130092055A (en) Image processing apparatus and method
TW201539398A (en) Three-dimensional map display system
CN103945209B (en) A kind of DIBR method based on piecemeal projection
CN104134201B (en) The method and apparatus of texture image splicing
Zhang et al. Fast stereo matching algorithm based on adaptive window
CN104639932A (en) Free stereoscopic display content generating method based on self-adaptive blocking
JP2015153144A (en) Information processing device, generating method, program, and recording medium

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180309

Termination date: 20200519

CF01 Termination of patent right due to non-payment of annual fee