1 / 28

A Quadrilateral Rendering Primitive

Kai Hormann · Marco Tarini. A Quadrilateral Rendering Primitive. A Quadrilateral Rendering Primitive. Visual Computing Group · CNR · Pisa. Motivation. our method. diagonal split. quadrilaterals. triangles. modelling primitive. rendering primitive. How to render a quad ?.

tomasso
Télécharger la présentation

A Quadrilateral Rendering Primitive

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Motivation our method diagonal split quadrilaterals triangles modelling primitive rendering primitive A Quadrilateral Rendering Primitive

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

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

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

  6. 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 A Quadrilateral Rendering Primitive

  7. 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 A Quadrilateral Rendering Primitive

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

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

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

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

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

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

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

  15. Interpolating vertex attributes 2 Σ A(v, vi+1,vi+2) a(v)= λi(v)ai λi(v)= i=0 A(v0, v1,v2) • triangles • barycentric coordinates • weights for linear interpolation v1 v v2 v0 A Quadrilateral Rendering Primitive

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

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

  18. Example • interpolating texture coordinates texture A Quadrilateral Rendering Primitive

  19. Perspective correction 3 3 3 / Σ 1 a(v)= λi(v)ai Σ Σ a(v)= λi(v) λi(v) ai wi i=0 i=0 i=0 wi without with A Quadrilateral Rendering Primitive

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

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

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

  23. Interpolating depth A Quadrilateral Rendering Primitive

  24. 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 A Quadrilateral Rendering Primitive

  25. 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 A Quadrilateral Rendering Primitive

  26. 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 A Quadrilateral Rendering Primitive

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

  28. 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 A Quadrilateral Rendering Primitive

More Related