CN104952103B - The shadow map creation method that a kind of viewpoint relies on - Google Patents

The shadow map creation method that a kind of viewpoint relies on Download PDF

Info

Publication number
CN104952103B
CN104952103B CN201510255989.5A CN201510255989A CN104952103B CN 104952103 B CN104952103 B CN 104952103B CN 201510255989 A CN201510255989 A CN 201510255989A CN 104952103 B CN104952103 B CN 104952103B
Authority
CN
China
Prior art keywords
space
vertebra
shadow
cut
shade
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.)
Expired - Fee Related
Application number
CN201510255989.5A
Other languages
Chinese (zh)
Other versions
CN104952103A (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 the shadow map creation method that a kind of viewpoint relies on, and view is cut into vertebra first and is cut to a shade real space, is then based on this shade real space to create shadow map.It is concretely comprised the following steps:(1), view cuts vertebra and cut:The non-shadow space that view is cut to vertebra part is deleted, and so as to form a tightened up shade encircling space, the space after this is cut is named as shade real space, and it is the minimum space for generating shadow map;(2), shadow map generates:Firstly generate light and cut vertebra, then by splitting above-mentioned shade real space, render the object in light section vertebra using shade camera and obtain echo.By the method for the present invention, non-shadow space is eliminated, solves the problems, such as the space overlap between echo;The resolution factor for ensuring echo and screen pixels by two-way partitioning algorithm matches;Vertebra cutting-out method is cut using view and removes non-shadow space, which greatly enhances the space availability ratio of echo.

Description

The shadow map creation method that a kind of viewpoint relies on
Technical field
The invention belongs to computer graphics techniques field, more particularly to a kind of shadow map establishment side of viewpoint dependence Method.
Background technology
Shade is very important visual signature, and shade gives the information about light source position in scene, highlights thing Spatial relationship between body.Therefore, Shading Rendering is a hot issue in computer graphics, especially in 3d gaming It is particularly important with the sense of reality for strengthening virtual scene in animation.These years, many methods have been proposed in Many researchers To solve the problems, such as real-time rendering.Shadow map algorithm (shadow mapping) is calculated as a kind of effective Shading Rendering Method has been widely used.Standard shadow textures are the algorithms based on image, so when the lack of resolution of shadow map, tradition Shadow map algorithm generation shade can cause crenellated phenomena.Traditional shadow map algorithm divides view by thresholding method Cut vertebra and create shadow map, non-shadow space can occupy a big chunk ratio in shadow map, and this is to cause shadow map Resolution ratio reduce a reason.The reason for another causes the resolution ratio of shadow map to reduce is between shadow map Space overlap.
Shadow map algorithm has simplicity and high efficiency, and Stamminger is in 2002 in " Perspective Shadow maps. ", Martin are 2004 in " Anti-aliasing and continuity with In trapezoidal shadow maps. ", shadow map, these sides are created by specifying truncated cone to be converted in light source space The problem of method is present be:Only a shadow map can not match the resolution ratio of a large scene.Fan Zhang,Hanqiu Sun, Leilei Xu, Lee Kit Lun are in 2006 in " Parallel-split shadow maps for large- A kind of PSSMs (parallel separation shadow map) algorithm, Rouslan are proposed in scale virtual environments " Dimitrov is in 2008 " Cascaded Shadow Maps " propose a kind of CSM (lamination shadow map) algorithm, and this two Kind method belongs to thresholding method, exists due to the problem of space overlap causes shadow quality to reduce between shadow map. Andrew Lauritzen, Marco Salvi, and Aaron Lefohn are in 2011 in " Sample distribution A kind of auto-partition algorithm by analyzing light source space depth profile is proposed in shadow maps. ", with first two algorithm Compare, the algorithm improves the utilization rate that shadow map excludes empty shade, but this method still has asking for space overlap Topic, it is very limited for the scene full of shadow object of complexity, improvement of this method to quality.In a word, traditional scene relies on The method for creating shadow map cuts the separation of vertebra, shade sample of these methods in spatial distribution based on thresholding method to view Aspect has advantage, but is the failure to solve the problems, such as that overlapping caused resolution ratio is low.It is limited to two that improve shadow quality Aspect:1st, space overlap:It is to be cut the AABB bounding boxs of vertebra by view or surrounded ball to generate that light, which cuts vertebra, and light cuts the sky of vertebra Between it is overlapping be it is inevitable, because space overlap causes the resolution ratio of shadow map to reduce;2nd, non-shadow space:Non-shadow is empty Between include horizontal plane under space and horizontal plane on there is no the space for including shade object, these non-shadow spaces are for shade wash with watercolours It is useless for dye, but they can still occupy a big chunk ratio of shadow map, cause the space of shadow map Utilization rate seriously reduces.
The content of the invention
It is an object of the invention to provide the shadow map creation method that a kind of viewpoint relies on, to solve non-shadow space proportion Greatly, the problem of space overlap between shadow map.
To achieve the above object, the technical solution adopted by the present invention is:
The shadow map creation method that a kind of viewpoint relies on, it is a shade visibility region that it is accurate that view is cut into vertebra first, This shade visibility region is then based on to create shadow map.
It is concretely comprised the following steps:
(1), view cuts vertebra and cut
The non-shadow space that view is cut to vertebra part is deleted, will so as to form the shadow object on a tightened up border Space after this cuts is named as shade visibility region, and it is the minimum space for generating shadow map;
(2), shadow map generates
Firstly generate light and cut vertebra, then by splitting above-mentioned shade real space, generate shadow view.
Delete the space without projected objects on the space for including being located under horizontal plane and horizontal plane in the non-shadow space.
View field is divided using two-way partitioning algorithm, cuts vertebra according to these partition creating light successively.
The viewport that light cuts vertebra is determined that the viewport of light section vertebra determines the viewport of shadow map again by its respective partition.
Vertebra is cut for light, its remote and hither plane should be by determining including all shadow objects inside its ken.
After light cuts vertebra determination, render the object in light section vertebra using shade camera and generate shadow map.
The beneficial effects of the invention are as follows:The present invention obtains shade real space by cutting view section vertebra, can for shade See that the projection in ray space in space is split, shadow map is created using segmentation result.By the present invention method, Non-shadow space is eliminated, solves the problems, such as the space overlap between shadow map;Shade is ensured by two-way partitioning algorithm Figure matching screen pixels distribution;Vertebra method of cutting out is cut using view and removes non-shadow space, which greatly enhances shadow map Space availability ratio;Compared with conventional method, the shadow map created by the method for the present invention has higher resolution ratio, shade Can under any visual angle seamless rendering.Shade shake is can't see in viewpoint moving process.In addition, method of the invention is realized It is relatively simple, it can apply to other programs.
Brief description of the drawings
Fig. 1 is that view cuts in vertebra the schematic diagram for deleting non-shadow space;
Fig. 2 is to create the schematic diagram that light cuts vertebra on light projection plane based on subregion;
Fig. 3 is the schematic diagram of view field longitudinal direction (left side) and horizontal (right side) subregion;
Fig. 4 is when observer is close to ground surface, and quality versus's figure is presented in (left side) of the invention and CSM (right side) shade;
Fig. 5 is when observer is close to ground surface, and Detail contrast figure is presented in (left side) of the invention and CSM (right side) shade;
Fig. 6 is (left side) the of the invention and contrast of CSM (right side) shade precision and seam when observer is away from ground surface Figure.
Embodiment
The present invention is further described below in conjunction with the accompanying drawings.
The problem of traditional shadow map algorithm can not reduce space overlap, it is because they create in a manner of scene relies on Shadow map is built, when creating shadow map, whole view is cut vertebra first and separated by these methods, is then cut by these views Vertebra segmentation section creates light and cuts vertebra.By conventional method, the viewport of shadow map cuts vertebra by light and determined, the resolution of shadow map Rate increase is limited to thresholding method.
The present invention proposes the shadow map establishment algorithm that a kind of viewpoint relies on and solves the problems, such as space overlap, to improve shade Quality, in the method for the invention, view is cut into vertebra first and is cut to a shade visibility region, being then based on this shade can Region is seen to create shadow map.
The shadow map creation method that the viewpoint of the present invention relies on comprises the following steps:
(1), view cuts vertebra and cut
By view cut vertebra part non-shadow space delete, non-shadow space delete include be located at horizontal plane under space and Space without projected objects on horizontal plane;
As shown in figure 1, non-shadow space includes the space without projected objects on the space under horizontal plane and horizontal plane, these Space is useless for Shading Rendering, them should be cut in vertebra from view and cropped, closer so as to form one Shade bounding box, the space after this is cut is named as shade real space, and it is the minimum for generating shadow map Space.
(2), shadow map generates
Firstly generate light and cut vertebra, cut vertebra by splitting above-mentioned shade visibility region using light, generate shadow view.
Shade real space after refinement is no longer a common truncated cone, and traditional view cuts vertebra partition method can not Space for this irregular shape of subregion, it is therefore desirable to which a new method is split to above-mentioned shade visibility region.
Above-mentioned shade real space is split to realize, we have proposed the dividing method that viewpoint relies on, , it is necessary to introduce the concept of light projection plane to understand the method in the method.
Light projection plane is any one plane vertical with light, and shade real space is projected in the plane, Ray cast plane forms the border of a view field;Only object is located in the view field of ray space, its depth Value can just be rendered into shadow map.
As shown in Fig. 2 view field is divided into multiple subregions, view field is divided using two-way partitioning algorithm, successively root Vertebra is cut according to these partition creating light.Light cut vertebra viewport determined by its respective partition, therefore the viewport of shadow map also by Its corresponding subregion determines.Vertebra is cut for light, its remote and hither plane should be by including all shadow objects inside its ken To determine.After light cuts vertebra determination, render the object in light section vertebra using shade camera and generate shadow map.
Light, which cuts vertebra, can be considered as the segmentation of shade real space, and its viewport size is according to their distance phases with viewpoint Close, avoid the space overlap problem that light is cut between vertebra.
Compared with conventional method, the shadow map created by the method for the present invention has the resolution more matched with screen pixels Rate.
The size of all shadow maps could be arranged to identical value, in this embodiment, be arranged to 2048 × 2048.
The method of view field's subregion is described in detail below:
By two-way partitioning algorithm, a suitable viewport is created for each shade camera.
As shown in figure 3, by the algorithm, view field is longitudinally split first, then horizontal partition again.
Such as Fig. 3, by view field make it is simple regard as one it is symmetrical trapezoidal, it is necessary to define one before detailed description A little symbols are used for following discussion.
θ (θ ∈ [0, pi/2)) be that observation is square and the angle on one side of view field, its value with the position of observer and Change;
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;
SiFor the subregion of view field, for a subregion Si(i > 1), its vertically and horizontally side are W respectivelyiAnd Hi
ρ is the space waste factor of each subregion, it represent outside view field partition space with entirely dividing into Ratio.
It is longitudinally split:
When view field carries out longitudinally split, the wasting space of each subregion is farthest limited;
ζ represents the maximum space factor for allowing waste in each subregion, and the length of side of each subregions of ρ≤ζ becomes in geometric progression Change,
In this case, corresponding echo precision will not suddenly change, increment coefficient σ by equation (1) Suo Shi,
Subregion SiThe length on two sides is:
Equation (2) can calculate the length of side of each subregion, and it can easily prove out the waste in each subregion Space is not more than ζ.
NHIt is longitudinal partition number, it should meet the following requirements:
NHAs observer changes and dynamic change, this ensures that shadow map creates in a dynamic way.To save internal memory, Rendering efficiency is improved, at utmost limits vertical partition quantity, NH≤NHmax(in the present embodiment, NHmax=4),
For subregionIts length of side is calculated as:
In practice,Size be likely larger than other subregions, its wasting space may exceed ζ.
But becauseRemote observer, only account for the screen space of very little ratio.Even if the resolution ratio of shadow map is not Foot, will not also have a negative impact to shadow quality.
Horizontal partition:
For shadow map, the difference of its uv resolution ratio should be limited to a certain limit ε,
This limitation is necessary, because can ensure that shade can all have higher resolution factor in uv directions, by vertical To segmentation, to meet this limitation.
According to longitudinally split scheme, for each region Si, WiNot less than Hi
In this case, it is only necessary to horizontal partition, as shown in Fig. 3 bottom rights.
Horizontal partition NWCorrespond to Si, calculate
NWBe it is conditional, in the present embodiment, NW≤2.The reasonability of this limitation, which is repeated experiment, to be proved.
Behind horizontal partition, the length of side W of each lower section subregionijIt is calculated as
In order to show advantages of the present invention, contrasted with CSM (cascade shadow map) algorithm.
In present embodiment, maximum space factor ζ=0.3 wasted, resolution ratio uv difference pole are allowed in each subregion It is 0.5 to limit ε.
CSM view cuts vertebra and is divided into 4 parts, and enables PCF Gaussian blurring functions,
As shown in Figures 4 and 5, the present invention is compared with conventional method, and when observer is close to ground surface, method of the invention is shown More shadow details.
Such as Fig. 6, when observer is away from ground surface, method of the invention can also keep high shadow quality, and not have Any shade seam.
The VSM of the present invention can realize the shade non-jitter in observer rocks.
In addition, efficiency of the invention is very high, in our computer accessory Core I7 CPU, 8G memory, and In the case of the GPU of GTX 780, average frame rate about 90fps.
Shade real space is projected ray cast plane by the present invention first, the algorithm pair then relied on using viewpoint View field carries out two-way segmentation, and the viewport of shadow map is determined by these subregions;Then, based on these partition creating light Line cuts vertebra.In this case, the viewport of light section vertebra is determined by projection subregion.It is of the invention compared with conventional method Method creates shadow map by opposite order:
Projection localization region of the shadow map based on shade real space creates, and solves space overlap and non-shadow space The problem of;To solve the problems, such as non-shadow space, view is cut into vertebra and is cut to shade real space;In order to solve space overlap Problem, shade real space is projected into ray cast plane, and the algorithm that viewpoint relies on according to viewpoint is carried out to view field Split.
Described above is only the preferred embodiment of the present invention, it should be pointed out that:For the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (7)

  1. A kind of 1. shadow map creation method that viewpoint relies on, it is characterised in that:View is cut into vertebra first and is cut to a shade Real space, this shade real space is then based on to create shadow map;It is concretely comprised the following steps:
    (1), view cut vertebra cut
    The non-shadow space that view is cut to vertebra part is deleted, so as to form a more close shadow object bounding box, by this Space after cutting is named as shade real space, and it is the minimum space for generating shadow map;
    (2), shadow map generation
    Firstly generate light and cut vertebra, light section vertebra realizes the segmentation to shade visibility region, utilizes light to cut vertebra generation shade Figure.
  2. 2. the shadow map creation method that viewpoint as claimed in claim 1 relies on, it is characterised in that:The non-shadow space bag Include the space without projected objects on space and the horizontal plane under horizontal plane.
  3. 3. the shadow map creation method that viewpoint as claimed in claim 1 relies on, it is characterised in that:Using two-way partitioning algorithm View field is divided into multiple subregions, cuts vertebra according to these partition creating light successively.
  4. 4. the shadow map creation method that viewpoint as claimed in claim 1 relies on, it is characterised in that:Light cut vertebra viewport by Its respective partition determines, so the viewport of shadow map is also determined by its corresponding subregion.
  5. 5. the shadow map creation method that viewpoint as claimed in claim 1 relies on, it is characterised in that:Vertebra is cut for light, its Remote and hither plane should be by determining including all shadow objects inside its ken.
  6. 6. the shadow map creation method that viewpoint as claimed in claim 1 relies on, it is characterised in that:After light cuts vertebra determination, The object in light section vertebra, which is rendered, using shade camera obtains shadow map.
  7. 7. the shadow map creation method that viewpoint as claimed in claim 3 relies on, it is characterised in that:The two-way partitioning algorithm Including:
    It is longitudinally split:It is longitudinally split to view field's progress, farthest limit the wasting space of each subregion;
    Horizontal partition:For shadow map, its resolution ratioDifference should be limited to a certain limit, , wherein,WithThe respectively subregion of view fieldVertically and horizontally edge lengths;By being carried out again to vertical partition Laterally division, to meet this limitation.
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 CN104952103A (en) 2015-09-30
CN104952103B true 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 (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022002716A1 (en) * 2020-06-30 2022-01-06 Interdigital Ce Patent Holdings, Sas Shadow-based estimation of 3d lighting parameters from reference object and reference virtual viewpoint

Families Citing this family (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
CN111028357B (en) * 2018-10-09 2020-11-17 北京嘀嘀无限科技发展有限公司 Soft shadow processing method and device of augmented reality equipment

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 (3)

* Cited by examiner, † Cited by third party
Title
Parallel-Split Shadow Maps for Large-scale Virtual Environments;Zhang F 等;《Vrcia 2006 ACM International Coference on Virtual Reality Continuum and ITS Applications》;20061231;第311-318页 *
航天器在轨飞行的实时可视化仿真;孙毅 等;《系统仿真学报》;20091031;第21卷;第124-127页 *
视景仿真系统中实时阴影绘制技术的研究;张勇 等;《系统仿真学报》;20060831;第18卷;第180-182页 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022002716A1 (en) * 2020-06-30 2022-01-06 Interdigital Ce Patent Holdings, Sas Shadow-based estimation of 3d lighting parameters from reference object and reference virtual viewpoint

Also Published As

Publication number Publication date
CN104952103A (en) 2015-09-30

Similar Documents

Publication Publication Date Title
Chaurasia et al. Depth synthesis and local warps for plausible image-based navigation
CN105247575B (en) System and method for being superimposed two dimensional map data on three-dimensional scenic
CN102592275B (en) Virtual viewpoint rendering method
CN104331918A (en) Occlusion culling and acceleration method for drawing outdoor ground surface in real time based on depth map
CN105224288B (en) Binocular three-dimensional method for rendering graph and related system
US9639971B2 (en) Image processing apparatus and method for processing transparency information of drawing commands
CN104952103B (en) The shadow map creation method that a kind of viewpoint relies on
US20140375633A1 (en) Texture Blending Between View-Dependent Texture and Base Texture in a Geographic Information System
CN102243768A (en) Method for drawing stereo picture of three-dimensional virtual scene
CN104299257A (en) Outdoor-sunlight-based method for realizing real-time dynamic shadow
CN102306401B (en) Left/right-eye three-dimensional picture drawing method for three-dimensional (3D) virtual scene containing fuzzy reflection effect
CN109461197B (en) Cloud real-time drawing optimization method based on spherical UV and re-projection
DuVall et al. Compositing light field video using multiplane images
Gu et al. Ue4-nerf: Neural radiance field for real-time rendering of large-scale scene
Wißmann et al. Accelerated stereo rendering with hybrid reprojection-based rasterization and adaptive ray-tracing
CN108765582A (en) A kind of panoramic pictures display methods and equipment
CN107689076A (en) A kind of efficient rendering intent during the cutting for system of virtual operation
KR101574422B1 (en) A method for rendering speed and editing efficiency improvement through single view video representation of multi-view video
Kolivand et al. Anti-aliasing in image based shadow generation techniques: a comprehensive survey
KR20090040515A (en) Apparatus and method for image space based shadowing with adaptive traversal scheme
Trapp et al. Occlusion management techniques for the visualization of transportation networks in virtual 3D city models
Eggert et al. Multi-layer visualization of mobile mapping data
JP2005173866A (en) Three-dimensional image display device
Kolivand et al. Shadow mapping or shadow volume?
Luo et al. Spherical projective displacement mesh

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

Granted publication date: 20180309

Termination date: 20200519