Presentation is loading. Please wait.

Presentation is loading. Please wait.

Virtual Reality: History Curs 5 Real-time rendering – randare în timp real.

Similar presentations


Presentation on theme: "Virtual Reality: History Curs 5 Real-time rendering – randare în timp real."— Presentation transcript:

1 Virtual Reality: History Curs 5 Real-time rendering – randare în timp real

2 Virtual Reality: History Real-time requirements: - Load poligonal scăzut pe pipeline-ul grafic Metode conservative si neconservative – – Culling (conservativ) – – Simplificare (neconservativ) – – IBR - Image Based Rendering (hibrid) Real Time rendering

3 Virtual Reality: History Culling

4 Virtual Reality: History Principiu culling: Poligoanele care nu sunt vizibile de către utilizator nu trebuie randate: – – Ascunse de alte poligoane ale aceluiai obiect (Backface culling) – – Înafara volumului de vedere (Viewfrustum culling) – – Ascunse de alte obiecte (Occlusion culling) Culling

5 Virtual Reality: History BackFace Culling

6 Virtual Reality: History Fiecare poligon este asociat cu o normală care îi determină orientarea Poligoanele sunt astfel: – – Frontfacing, când normala intersectează planul utilizatorului – – Backfacing, în caz contrar În cazul obiectelor convexe, poligoanele backfacing sunt ascunse de cele frontfacing V = Vizibil I = Invizibil Backface culling

7 Virtual Reality: History De la un viewpoint specific, doar câteva poligoane sunt vizibile (statistic 50 %) Ignorând aceste poligoane, teoretic, performanele ar trebui să crească mult (de 2 ori). De fapt, acest lucru nu are loc din cauza calculului orientării care este realizat în pipeline-ul grafic, după transformările geometice Backface culling

8 Virtual Reality: History Backface culling hardware Plăcile grafice au implementate un HW backface test, care elimină poligoanele BF polygons înainte de etapa de iluminare BF test este reprezentat de produsul scalar dintre normala la poligon (N p ) i direcia de privire (D): B = N p D B 0 backfacing Np

9 Virtual Reality: History Backface culling software Ar fi bine să găsim poligoanele BF polys înainte de accesul la pipeline-ul grafic Există tehnici SW Sunt eficiente dacă sunt folosite structuri ierarhice NORMAL MASKS (Zhang e Hoff, 1997) – – preprocessing (normal masks preparation) – – run-time (test)

10 Virtual Reality: History ViewFrustum Culling

11 Virtual Reality: History Poligoanele care nu sunt incluse în volumul de vedere nu sunt vizibile Acestea trebuie identificate pentru a nu fi trimise la pipeline Viewfrustum culling

12 Virtual Reality: History Viewfrustum culling CLIPPING Removal of triangles (or portions) not falling inside the view volume CLIPPING Removal of triangles (or portions) not falling inside the view volume Efficient HW technique Efficient HW technique Takes place later in the pipeline Takes place later in the pipeline Does not affect the polygonal load on thee pipeline Does not affect the polygonal load on thee pipeline

13 Virtual Reality: History Viewfrustum culling VF culling is an anticipated clipping Geometry is divided in: – – Inside Viewfrustum (visible) RENDERED – – Outside Viewfrustum (invisible) CULLED Simple VF Culling: – – Each polygon is tested – – Ineffective for many polygons – – Scene Graph needed

14 Virtual Reality: History Viewfrustum culling Hierarchical VF Culling: – – Nodes are tested (Bounding Volumes or SG node) – – If the node is completely outside the VF, so do also all the contained polys CULLED – – If the node is completely inside so do also all the contained polys RENDERED – – If the node is PARTIALLY inside: Lower level nodes are tested If the node is a leaf: – –Test on all polygons (uneffective) – –All the polygons are RENDERED

15 Virtual Reality: History Frame to Frame Coherence: Objects not visible at time t, will be probably not visible also at t+ t Coherence test for traslation ( d) and rotation ( ) of the viewpoint: BS d d < distance Still outside d > distance Check direction, then possibly check VF against VF Still outside towards VF Check VF Viewfrustum culling

16 Virtual Reality: History An object is outside the VF if it is behind at least one of its planes: Considering planes normals oriented towards the VR inside : – – For a point: distance from plane < 0 – – For a sphere: distance center from plane < - r – – For a box: distance of its vertices < 0 (all 8 checks needed?) Calculations are relatively simple, however the planes equations may be tricky VF Culling test BS BB

17 Virtual Reality: History The projection transforms the VR into a cube of vertices (±1,±1, ±1) (clip space) Planes in Clip Space are easy to determine: – – Eq. generic: ax+by+cz+d = 0 – – In this case: x = 1, x = -1, etc. With the projection matrix the points to be checked can be trasformed quickly and tests can take place in the clip space Frustum in Clip Space

18 Virtual Reality: History Occlusion Culling

19 Virtual Reality: History Occlusion culling Some polygons, although front-facing within the VF, can be hidden by other objects Z-Buffering – – Occlusion tested at pixel level – – For each (x,y,z) in WindowSpace, the z value is tested against the z- buffer one related to position (x,y) – – If z is smaller the point is occlubed – – Also in this case: It is made downstream the pipeline Hidden polygons/objects should be identified upstream Note: occlusion culling algorithms are usually heavy, should be used with HUGE scenes

20 Virtual Reality: History Occlusion culling: HOM Hierarchical Occlusion Map (Zhang, Manocha, Hudson e Hoff 1997) Preprocessing: – – OCCLUDER identification (probable occluder) Quite big, possibly not too many polys – – Creation of the OCCLUDER db Depending on size and distance from the VP, at run-time some occluder are extracted For each object a depth test is performed to check if it is behind an occluder

21 Virtual Reality: History Occlusion culling: HOM Minimal depth-test: a plane behind the occluder is tested: if the object is behind this plane is a good candidate to be culled Which depth test is made?

22 Virtual Reality: History Occlusion culling: HOM Smart run-time phase: First, only the occluders are drawn in white. A grey scale hierarchical map is retrieved (cluster 2x2 -> 1 pixel with averaged color) Objects BVs are tested against the map (starting with the coarsest level): If the BV falls inside a white zone the object MAY be occluded: the depth-test will take place If the BV falls inside a zone with even ONE non-white pixel, the immediately finer level is checked Aggressive (non conservative) culling: the depth-test takes place even after a certain grey threshold (this means that objects might be almost occluded)

23 Virtual Reality: History Occlusion culling: HOM

24 Virtual Reality: History Portal Culling

25 Virtual Reality: History Potentially Visible Sets Hi-level technique for architectural VE Environment subdivided in: – – CELLS: portions of space (usually BOXes) – – PORTALS: 2D area connecting two cells In architectural VEs: – – CELL = Room – – PORTAL = Door, Window, Mirror Two cells can see each other through a portal Potentially visible set: – – Set of cells visible from a certain view point

26 Virtual Reality: History Potentially Visible Sets Building the PVS: – – Active cell (where the observer is) is in the PVS – – The cells visible from the active cell are in the PVS – – The cells not inside the PVS are culled Inside the PVS standard visibility techniques might be used Not suitable for all the VEs (with some modifications can be adapted to outdoor VEs)

27 Virtual Reality: History Simplification techniques

28 Virtual Reality: History Simplification Operate on the model complexity The idea is that, in some circumstances, simplified models can be used withouth modifying too much the final result Generally there is a loss of details: non-conservative techniques Techniques: Level of Detail Image Based Rendering

29 Virtual Reality: History Level of Detail Objects far from the VP do not need too many details, as they are not visible They can do simplified depending on distance and angulation from the observer LODs are alternative versions of the same mesh with different levels of complexity

30 Virtual Reality: History Level of Detail LOD can be created: Off-line (maximum control, pre fixed complexity) Run-time (variable complexity) run-time: progressive meshes Dynamic lods Only Δs are stored Optimal for network distribution

31 Virtual Reality: History Image Based Rendering

32 Virtual Reality: History Image Based Rendering Culling and LOD tecnhiques aim to reduce the polygonal budget IBR aims to substitute polygons with images Very effective if used together with the other techniques Methods: Static (Database Approach, Sprites) Dynamic (Impostors)

33 Virtual Reality: History Billboards Textures allow to simulate complex visual details on simple shapes. Even only one polygon! Billboards are textured quads that rotate so as to always face the viewpoint Good approximation for symmetric objects Simmetry: Cylindric: axial rotation = arccos(V dB n ) Spheric: two rotation axes

34 Virtual Reality: History Database Approach Basic idea: All the possible views of an object are rendered and, at run-time, the one corresponding to the current VP is chosen Actually, only a limited set of VPs are used. At run-time: The image corresponding the the closest VP is renderd Images are interpolated (morphing)

35 Virtual Reality: History Impostors IMPOSTORS: IMPOSTORS: the view of the object is grabbed during the run-time phase so as to exploit the frame-to-frame coherence: probably in the next frame the object will have (almost) the same appearance

36 Virtual Reality: History Impostors Impostors are view-dependent: the grabbed image is a faithful representation of an object only in a certain viewpoint V In a range R of viewpoints around V the impostor is still a good approximation, outside the image can be very different Outside R either the object must be rendered again or a new impostor must be created

37 Virtual Reality: History An impostor is valid in the frame when it is created The impostor is valid if the observer performs only ROTATIONAL movements (the projection on the viewplane is not affected) For translational movements, the representation changes. Beyond a certain s lateral or forward, the error becomes too big. After a certain threshold a new impostor must be created Impostors

38 Virtual Reality: History Impostors: errors Objects are not anymore 3D This leads to errors in intersecting objects Possible solution: layered impostors


Download ppt "Virtual Reality: History Curs 5 Real-time rendering – randare în timp real."

Similar presentations


Ads by Google