real-time pencil rendering
DESCRIPTION
Real-Time Pencil Rendering. Marc Treib. Contents. Introduction: Pencil Drawing Challenges Contours Interior Shading: Hatching Object vs. Screen Space Implementation in Object Space Implementation in Screen Space Results Summary. 1 Introduction: Pencil Drawing. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/1.jpg)
computer graphics & visualization
Real-Time Pencil Rendering
Marc Treib
![Page 2: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/2.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
Contents1. Introduction: Pencil Drawing2. Challenges3. Contours4. Interior Shading: Hatching
1. Object vs. Screen Space2. Implementation in Object Space3. Implementation in Screen Space
5. Results6. Summary
![Page 3: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/3.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
1 Introduction: Pencil Drawing
![Page 4: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/4.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
1 Introduction: Pencil Drawing
![Page 5: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/5.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
1 Introduction: Pencil Drawing
![Page 6: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/6.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
2 Challenges• Contours:– Errors in contours– Multiple „trial-and-error“ lines
• Hatching:– Maintain constant stroke size– Continuously adjust stroke density– Align stroke direction with shape (curvature)
![Page 7: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/7.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
3.1 Contour Detection• Object Space Approach:
– But how to implement this?
![Page 8: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/8.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
3.1 Contour Detection• Screen Space Approach:– Render depth and normals to textures
– Apply edge detection algorithm (in a pixel shader)
– Optionally: Object IDs (colors)
![Page 9: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/9.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
3.2 Contour Shaking• Divide screen into regularly sized rectangles• Perturb texture coordinates– E.g. with sine function + random offset
• Map contour image onto this distorted plane• Repeat for multiple lines
![Page 10: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/10.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
4.1 Hatching: Object vs. Screen Space• Object space approach:
+ Strokes stick to objects- Need to adapt stroke widths and densities with distance- Need continuous global parameterization
Map textures containing pencil strokes onto objects, like conventional texture mapping
![Page 11: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/11.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
4.1 Hatching: Object vs. Screen Space• Screen space approach:
Map stroke textures onto objects in screen space
+ Easier control of stroke widths and densities- No object space continuity- „Shower-door-effect“
![Page 12: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/12.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
4.2 Implementation in Object Space• Tonal Art Maps:
• Strokes in one image appear in all images to the right and down from it
• Store in 3d texture
![Page 13: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/13.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
4.2 Implementation in Object Space• Rendering:
6-way blending
![Page 14: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/14.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
4.2 Implementation in Object Space• To circumvent the need for a continuous global
parameterization:Use Lapped Textures
![Page 15: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/15.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
4.3 Implementation in Screen Space• Stroke textures:– Similar to object space approach, but don‘t need to
bother with mipmaps
![Page 16: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/16.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
4.3 Implementation in Screen Space• In the vertex shader:– Project 3d curvature direction onto screen space– Compute brightness
• In the pixel shader:– For each vertex, rotate texture coordinates to
projected curvature direction– Blend 3 stroke textures (one per vertex)
![Page 17: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/17.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
5 Results
![Page 18: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/18.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
5 Results
![Page 19: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/19.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
5 Results
![Page 20: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/20.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
5 Results
Demo!
![Page 21: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/21.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
6 Summary• Contours:– Edge detection using 2d image processing algorithm– Errors in contours by projecting onto distorted plane
• Interiors:– In object space:• Tonal Art Maps, 6-way blending, Lapped Textures
– In screen space:• Rotate and map textures in screen space, 3-way blending
![Page 22: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/22.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
Thanks for listening!Questions?
![Page 23: Real-Time Pencil Rendering](https://reader036.vdocuments.mx/reader036/viewer/2022062323/568162ab550346895dd32dd9/html5/thumbnails/23.jpg)
computer graphics & visualization
Real-Time Pencil Rendering – 2007-07-25Marc Treib
Bibliography• Emil Praun, Adam Finkelstein and Hugues Hoppe. Lapped textures. In
SIGGRAPH '00: Proceedings of the 27th annual conference on Computer graphics and interactive techniques, 2000.
• Emil Praun, Hugues Hoppe, Matthew Webb and Adam Finkelstein. Real-time hatching. In SIGGRAPH '01: Proceedings of the 28th annual conference on Computer graphics and interactive techniques, 2001.
• Matthew Webb, Emil Praun, Adam Finkelstein and Hugues Hoppe. Fine tone control in hardware hatching. In NPAR '02: Proceedings of the 2nd international symposium on Non-photorealistic animation and rendering, 2002.
• Hyunjun Lee, Sungtae Kwon and Seungyong Lee. Real-time pencil rendering. In NPAR '06: Proceedings of the 4th international symposium on Non-photorealistic animation and rendering, 2006.