Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Quadrilateral Rendering Primitive Kai Hormann · Marco Tarini A Quadrilateral Rendering Primitive Visual Computing Group · CNR · Pisa.

Similar presentations


Presentation on theme: "A Quadrilateral Rendering Primitive Kai Hormann · Marco Tarini A Quadrilateral Rendering Primitive Visual Computing Group · CNR · Pisa."— Presentation transcript:

1 A Quadrilateral Rendering Primitive Kai Hormann · Marco Tarini A Quadrilateral Rendering Primitive Visual Computing Group · CNR · Pisa

2 A Quadrilateral Rendering Primitive Motivation our methoddiagonal split quadrilateralstriangles modelling primitiverendering primitive

3 A Quadrilateral Rendering Primitive How to render a quad ? diagonal split two triangles linear in each triangle diagonal visible (C 0 ) diagonal split two triangles linear in each triangle

4 A Quadrilateral Rendering Primitive How to render a quad ? diagonal split two triangles linear in each triangle diagonal visible (C 0 )

5 A Quadrilateral Rendering Primitive How to render a quad ? two-fold linear linear along edges linear along horizontal spans two horizontal lines visible (C 0 ) strongly view dependent two-fold linear linear along edges linear along horizontal spans

6 A Quadrilateral Rendering Primitive How to render a quad ? projective map unique mapping from unit square to quad false depth-impression not linear along edges convex quads only projective map unique mapping from unit square to quad

7 A Quadrilateral Rendering Primitive How to render a quad ? bilinear interpolation unique mapping from unit square to quad costly geometry refinement required unfeasible for hardware implementation bilinear interpolation unique mapping from unit square to quad

8 A Quadrilateral Rendering Primitive How to render a quad ? diagonal split 1 diagonal split 0 two-fold linear projective map bilinear interpolation new method

9 A Quadrilateral Rendering Primitive vertex process 2D screen quad General concept 3D vertices fragment process final pixels rasterizer fragments

10 A Quadrilateral Rendering Primitive General concept vertex process 2D screen quad 3D vertices fragment process final pixels rasterizer fragments remains the same project vertices define vertex attributes etc.

11 A Quadrilateral Rendering Primitive General concept remains the same depth test shading texture accesses etc. vertex process 2D screen quad 3D vertices fragment process final pixels rasterizer fragments remains the same depth test shading texture accesses etc.

12 A Quadrilateral Rendering Primitive General concept vertex process 2D screen quad 3D vertices fragment process final pixels rasterizer fragments a new quad rasterizer determine fragments to be covered interpolate attributes per fragment

13 A Quadrilateral Rendering Primitive Determine fragments to be covered possible shapes of 2D screen quads rasterization general scan-line algorithm via edge-functions concave (v-shape) self-intersecting (cross-shape) convex

14 A Quadrilateral Rendering Primitive General concept vertex process 2D screen quad 3D vertices fragment process final pixels rasterizer fragments a new quad rasterizer determine fragments to be covered interpolate attributes per fragment

15 A Quadrilateral Rendering Primitive v0v0 v2v2 v1v1 v Interpolating vertex attributes triangles barycentric coordinates weights for linear interpolation λ i (v) = A(v, v i+1,v i+2 ) A(v 0, v 1,v 2 ) a(v) = λ i (v) a i Σ i=0 2

16 A Quadrilateral Rendering Primitive Generalized barycentric coordinates quadrilaterals mean value coordinates (Floater 2003) vivi v i-1 v i+1 v α i-1 αiαi riri μ i (v) = riri tan + tan α i-1 2 αiαi 2 λ i (v) = μiμi μjμj Σ j=0 3

17 A Quadrilateral Rendering Primitive Generalized barycentric coordinates properties Lagrange property linear along edges positive work for all shapes smooth (C ∞ inside) distinguish front/back-facing not too costly to compute vivi v i-1 v i+1 v α i-1 αiαi riri

18 A Quadrilateral Rendering Primitive Example interpolating texture coordinates texture

19 A Quadrilateral Rendering Primitive Perspective correction a(v) = Σ i=0 3 λ i (v) aiai wiwi / Σ i=0 3 λ i (v) 1 wiwi withoutwith a(v) = λ i (v) a i Σ i=0 3

20 A Quadrilateral Rendering Primitive Works in all cases possible shapes of 2D screen quads concave (v-shape) self-intersecting (cross-shape) convex

21 A Quadrilateral Rendering Primitive Points behind the eye it also works for exterior quads all vertices in front some vertices behind

22 A Quadrilateral Rendering Primitive Points behind the eye 1. 2. 3. 4. 5. 6.

23 A Quadrilateral Rendering Primitive Interpolating depth

24 A Quadrilateral Rendering Primitive Discussion blends well with current architecture modifies the rasterizer only vertex and fragment ops unchanged properties of triangles carry over  depth calculation  behaviour along edges allows mixed triangle/quad meshes OpenGL and DirectX friendly

25 A Quadrilateral Rendering Primitive Application front-end OpenGL quads are part of current syntax our quads comply with the specs re-implement GL_QUADS in the API DirectX need to add a new primitive type

26 A Quadrilateral Rendering Primitive Discussion rasterization cost generalized barycentric coordinates  for example, 19 ARB instructions edge functions for membership test  5 instead of 3 fewer and larger primitives  1 quad instead of 2 triangles

27 A Quadrilateral Rendering Primitive Discussion increased quality quad meshes look much better almost identical to a refined mesh view-dependency

28 A Quadrilateral Rendering Primitive Future work improving the method extend to other primitives? simplify formulas? avoid view-dependency? turn it into hardware discuss feasibility with  graphics card developers  DirectX developers  OpenGL community


Download ppt "A Quadrilateral Rendering Primitive Kai Hormann · Marco Tarini A Quadrilateral Rendering Primitive Visual Computing Group · CNR · Pisa."

Similar presentations


Ads by Google