real-time non- photorealistic rendering › ~cs767 › student_pres › ... · real-time...

57
Real Real - - Time Non Time Non - - Photorealistic Rendering Photorealistic Rendering Presented by: Presented by: Qing Qing Hu Hu LIAO LIAO SOCS, McGill SOCS, McGill Feb 1, 2005 Feb 1, 2005

Upload: others

Post on 24-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

RealReal--Time NonTime Non--Photorealistic RenderingPhotorealistic Rendering

Presented by: Presented by: QingQing HuHu LIAOLIAO

SOCS, McGill SOCS, McGill Feb 1, 2005Feb 1, 2005

Page 2: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

IndexIndex

IntroductionIntroductionMotivationMotivationAppelAppel’’ss AlgorithmAlgorithmImproving SchemaImproving SchemaRenderingRenderingResultResult

Page 3: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

““EEconomy of lineconomy of line””

A great deal of information could be effectively A great deal of information could be effectively conveyed by very few strokes.conveyed by very few strokes.

Non-Photorealistic Rendering?The Gazette, Jan 27, 05

Page 4: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

IntroductionIntroduction

NPR often emphasis the NPR often emphasis the visiblevisiblefeatures edgesfeatures edges::–– Silhouette;Silhouette;–– Crease, border, and etc.Crease, border, and etc.

Morgan McGuire jgt 2004

Page 5: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

IntroductionIntroduction

NPR often emphasis the NPR often emphasis the visible visible features edgesfeatures edges::–– Silhouette;Silhouette;–– Crease, border, and etc.Crease, border, and etc.

NaNaïïve visibleve visible--line detection line detection algorithm (algorithm (Ray TracingRay Tracing): ): –– Easy to implement;Easy to implement;–– But slow: O (n*n).But slow: O (n*n).

Morgan McGuire jgt 2004

Page 6: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

MotivationMotivationFind and render visible feature edges in Find and render visible feature edges in realreal--timetime..–– use a modification of use a modification of AppelAppel’’ss visiblevisible--line algorithmline algorithm (APPE67).(APPE67).

Page 7: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

MotivationMotivationFind and renderFind and render visible feature edges in visible feature edges in realreal--timetime..–– use a modification of use a modification of AppelAppel’’ss visiblevisible--line algorithmline algorithm (APPE67).(APPE67).

Why not ZWhy not Z--buffer algorithm?buffer algorithm?

Page 8: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

MotivationMotivationFind and renderFind and render visible feature edges in visible feature edges in realreal--timetime..–– use a modification of use a modification of AppelAppel’’ss visiblevisible--lineline algorithm (APPE67).algorithm (APPE67).

Why not ZWhy not Z--buffer algorithm?buffer algorithm?–– CanCan’’t easily produce different handt easily produce different hand--drawn styles for visible feature drawn styles for visible feature

lines or surface:lines or surface:Since the handSince the hand--drawn strokes have different geometry shape with the drawn strokes have different geometry shape with the corresponding feature lines or surface.corresponding feature lines or surface.

Page 9: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

MotivationMotivationFind and renderFind and render visible feature edges in visible feature edges in realreal--timetime..–– use a modification of use a modification of AppelAppel’’ss visiblevisible--lineline algorithm (APPE67).algorithm (APPE67).

Why not ZWhy not Z--buffer algorithm?buffer algorithm?–– CanCan’’t easily produce different handt easily produce different hand--drawn styles for visible feature drawn styles for visible feature

lines or surface:lines or surface:Since the handSince the hand--drawn strokes have different geometry shape with the drawn strokes have different geometry shape with the corresponding feature lines or surface.corresponding feature lines or surface.

–– Historical reason:Historical reason:Vertex and fragment Shader (GPU) not available.Vertex and fragment Shader (GPU) not available.

Page 10: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

DefinitionsDefinitions

Front-facing & & BackBack--facingfacing PolygonsPolygons–– Determined by the sign of dotDetermined by the sign of dot--product of normal product of normal

direction and view direction.direction and view direction.

Appel’s visible-line algorithm

Page 11: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

DefinitionsDefinitions

Silhouette Edge–– Adjacent to one frontAdjacent to one front--

facing and one backfacing and one back--facing facing polygon.polygon.

–– Edge AB, CD, KL, DF, Edge AB, CD, KL, DF, ……

Appel’s visible-line algorithm

Page 12: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

DefinitionsDefinitions

Silhouette Edge–– Adjacent to one frontAdjacent to one front--

facing and one backfacing and one back--facing facing polygon.polygon.

–– Edge AB, CD, KL, DF, Edge AB, CD, KL, DF, ……

Border EdgeBorder Edge–– Adjacent to just one face.Adjacent to just one face.

Appel’s visible-line algorithm

Page 13: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

DefinitionsDefinitions

Silhouette Edge–– Adjacent to one frontAdjacent to one front--

facing and one backfacing and one back--facing facing polygon.polygon.

–– Edge AB, CD, KL, DF, Edge AB, CD, KL, DF, ……

Border EdgeBorder Edge–– Adjacent to just one face.Adjacent to just one face.

Contour Edge:Contour Edge:–– Silhouette edge;Silhouette edge;–– Border edge.Border edge. Appel’s visible-line algorithm

Page 14: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Quantitative Invisibility (Quantitative Invisibility (QIQI))

QI of a point on a line:–– The number of frontThe number of front--facing polygons facing polygons

that obscure that point from eye;that obscure that point from eye;

Appel’s visible-line algorithm

Page 15: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Quantitative Invisibility (Quantitative Invisibility (QIQI))

QI of a point on a line:–– The number of frontThe number of front--facing polygons facing polygons

that obscure that point from eye;that obscure that point from eye;–– Increase by 1 when pass behind a Increase by 1 when pass behind a

frontfront--facing polygon;facing polygon;

Appel’s visible-line algorithm

Page 16: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Quantitative Invisibility (Quantitative Invisibility (QIQI))

QI of a point on a line:–– The number of frontThe number of front--facing polygons facing polygons

that obscure that point from eye;that obscure that point from eye;–– Increase by 1 when pass behind a Increase by 1 when pass behind a

frontfront--facing polygon;facing polygon;–– Decrease by 1 when pass out that Decrease by 1 when pass out that

frontfront--facing polygon;facing polygon;

Appel’s visible-line algorithm

Page 17: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Quantitative Invisibility (Quantitative Invisibility (QIQI))

QI of a point on a line:–– The number of frontThe number of front--facing polygons facing polygons

that obscure that point from eye;that obscure that point from eye;–– Increase by 1 when pass behind a Increase by 1 when pass behind a

frontfront--facing polygon;facing polygon;–– Decrease by 1 when pass out that Decrease by 1 when pass out that

frontfront--facing polygon;facing polygon;–– Only change when pass behind Only change when pass behind

a contour line (silhouette or a contour line (silhouette or border edges).border edges).

Appel’s visible-line algorithm

Page 18: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Quantitative Invisibility (Quantitative Invisibility (QIQI))

QI of a point on a line:–– The number of frontThe number of front--facing polygons facing polygons

that obscure that point from eye;that obscure that point from eye;–– Increase by 1 when pass behind a Increase by 1 when pass behind a

frontfront--facing polygon;facing polygon;–– Decrease by 1 when pass out that Decrease by 1 when pass out that

frontfront--facing polygon;facing polygon;–– Only change when pass behind Only change when pass behind

a contour line (silhouette or a contour line (silhouette or border edges).border edges).

A point is visible only when QI=0.A point is visible only when QI=0.

Appel’s visible-line algorithm

Page 19: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Complication VertexComplication Vertex

Appel’s visible-line algorithm

Complication vertex is vertex on silhouette edges:–– Through which the Through which the QIQI value should be computed value should be computed

according to local adjacent polygons.according to local adjacent polygons.

Page 20: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Complication VertexComplication Vertex

Appel’s visible-line algorithm

Complication vertex is vertex on silhouette edges:–– Through which the Through which the QIQI value should be computed value should be computed

according to local adjacent polygons. according to local adjacent polygons. –– Examples of complication vertex:Examples of complication vertex:

Vertex Vertex K: QIK: QI change along change along JJ--KK--L.L.

Page 21: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Complication VertexComplication Vertex

Appel’s visible-line algorithm

Complication vertex is vertex on silhouette edges:–– Through which the Through which the QIQI value should be computed value should be computed

according to local adjacent polygons. according to local adjacent polygons. –– Examples of complication vertex:Examples of complication vertex:

Vertex Vertex K: QIK: QI change along change along JJ--KK--L.L.Vertex Vertex K: K: no change alongno change along JJ--KK--M.M.

M

Page 22: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Complication VertexComplication VertexComplication vertex is vertex on silhouette edges:–– Through which the Through which the QIQI value should be computed value should be computed

according to local adjacent polygons.according to local adjacent polygons.–– Examples of complication vertex:Examples of complication vertex:

Vertex Vertex K: QIK: QI change along change along JJ--KK--L.L.Vertex Vertex K: K: no change alongno change along JJ--KK--M.M.

–– Examples of normal vertex:Examples of normal vertex:Vertex Vertex EE: no change along any path.: no change along any path.

Appel’s visible-line algorithm

Page 23: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Edge coherenceEdge coherence

Edge coherence:Edge coherence: along the mesh of edges, QI along the mesh of edges, QI only changes when:only changes when:

Page 24: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Edge coherenceEdge coherence

Edge coherence:Edge coherence: along the mesh of edges, QI along the mesh of edges, QI only changes when:only changes when:–– PPass behind a contour edge, orass behind a contour edge, or

Page 25: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Edge coherenceEdge coherence

Edge coherence:Edge coherence: along the mesh of edges, QI along the mesh of edges, QI only changes when:only changes when:–– PPass behind a contour edge, orass behind a contour edge, or–– EEncounter a complication vertex. ncounter a complication vertex.

Page 26: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

AppelAppel’’ss visiblevisible--line Algorithmline AlgorithmTake advantage of Take advantage of edge coherenceedge coherence to compute to compute QIQI value of value of all the vertex in the models from a viewpoint:all the vertex in the models from a viewpoint:

No.No. StepStep MethodMethod LoadLoad

11

22

33

Page 27: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

AppelAppel’’ss visiblevisible--line Algorithmline AlgorithmTake advantage of Take advantage of edge coherenceedge coherence to compute to compute QIQI value of value of all the vertex in the models from a viewpoint:all the vertex in the models from a viewpoint:

No.No. StepStep MethodMethod LoadLoad

11 Detect all the contour edges of the Detect all the contour edges of the models from a specified viewpoint.models from a specified viewpoint.

Exhaustive searchExhaustive search HeavyHeavy

22

33

Page 28: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

AppelAppel’’ss visiblevisible--line Algorithmline AlgorithmTake advantage of Take advantage of edge coherenceedge coherence to compute to compute QIQI value of value of all the vertex in the models from a viewpoint:all the vertex in the models from a viewpoint:

No.No. StepStep MethodMethod LoadLoad

11 Detect all the contour edges of the Detect all the contour edges of the models from a specified viewpoint.models from a specified viewpoint.

Exhaustive searchExhaustive search HeavyHeavy

22 Compute QI for a Compute QI for a ““seedseed”” vertex via vertex via brutebrute--force computation.force computation.

Ray tracingRay tracing MediumMedium

33

Page 29: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

AppelAppel’’ss visiblevisible--line Algorithmline AlgorithmTake advantage of Take advantage of edge coherenceedge coherence to compute to compute QIQI value of value of all the vertex in the models from a viewpoint:all the vertex in the models from a viewpoint:

No.No. StepStep MethodMethod LoadLoad

11 Detect all the contour edges of the Detect all the contour edges of the models from a specified viewpoint.models from a specified viewpoint.

Exhaustive searchExhaustive search HeavyHeavy

22 Compute QI for a Compute QI for a ““seedseed”” vertex via vertex via brutebrute--force computation.force computation.

Ray tracingRay tracing heavyheavy

33 Propagate the seedPropagate the seed’’s QI value out s QI value out through connected edges by through connected edges by (1):(1): finding the intersections with finding the intersections with contour edges in contour edges in image spaceimage space and and (2):(2): taking care of the complication taking care of the complication vertex.vertex.

SweepSweep--lineline MediumMedium

Page 30: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Improving Improving AppelAppel’’ss AlgorithmAlgorithm

This paper proposed some improvements over This paper proposed some improvements over the original the original AppelAppel’’ss algorithm and make it algorithm and make it suitable for realsuitable for real--time interactive application.time interactive application.

Page 31: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Improving Improving AppelAppel’’ss AlgorithmAlgorithm

This paper proposed some improvements over This paper proposed some improvements over the original the original AppelAppel’’ss algorithm and make it algorithm and make it suitable for realsuitable for real--time interactive application.time interactive application.Focus primarily on finding the silhouette edges Focus primarily on finding the silhouette edges quickly, since:quickly, since:–– Directly improve step 1 of Directly improve step 1 of AppelAppel’’ss algorithm.algorithm.–– The most important feature edges for NPR.The most important feature edges for NPR.

Page 32: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Improving Improving AppelAppel’’ss AlgorithmAlgorithm

Step 1:Step 1:–– A fast randomized algorithm for finding silhouette.A fast randomized algorithm for finding silhouette.

Page 33: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Improving Improving AppelAppel’’ss AlgorithmAlgorithm

Step 1:Step 1:–– A fast randomized algorithm for finding silhouette.A fast randomized algorithm for finding silhouette.

Step 2:Step 2:–– Avoiding ray tracing tests for Avoiding ray tracing tests for ““seedseed”” to determine to determine

visibility of silhouette, orvisibility of silhouette, or–– Efficient ray tracing via Efficient ray tracing via ““walkingwalking”” or or OctreeOctree

Technique.Technique.

Page 34: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Improving Improving AppelAppel’’ss AlgorithmAlgorithm

Step 1:Step 1:–– A fast randomized algorithm for finding silhouette.A fast randomized algorithm for finding silhouette.

Step 2:Step 2:–– Avoiding ray tracing tests for Avoiding ray tracing tests for ““seedseed”” to determine to determine

visibility of silhouette, orvisibility of silhouette, or–– Efficient ray tracing via Efficient ray tracing via ““walkingwalking”” or or OctreeOctree

Technique.Technique.Step 3: Step 3: –– Check Cusp vertex along silhouette edges.Check Cusp vertex along silhouette edges.

Page 35: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Fast Randomized AlgorithmFast Randomized Algorithmfor Finding Silhouettesfor Finding Silhouettes

Silhouette edges form closed curves on 3D model space.Silhouette edges form closed curves on 3D model space.

Page 36: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Fast Randomized AlgorithmFast Randomized Algorithmfor Finding Silhouettesfor Finding Silhouettes

Silhouette edges form closed curves on 3D model space.Silhouette edges form closed curves on 3D model space.Algorithm:Algorithm:–– Weight all the edges according to:Weight all the edges according to:

dihedral angle.dihedral angle.Being silhouette edges in previous frame.Being silhouette edges in previous frame.

Page 37: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Fast Randomized AlgorithmFast Randomized Algorithmfor Finding Silhouettesfor Finding Silhouettes

Silhouette edges form closed curves on 3D model space.Silhouette edges form closed curves on 3D model space.Algorithm:Algorithm:–– Weight all the edges according to:Weight all the edges according to:

dihedral angle.dihedral angle.Being silhouette edges in previous frame.Being silhouette edges in previous frame.

–– Choose a small fraction of edges Choose a small fraction of edges randomlyrandomly according to the according to the weight.weight.

Page 38: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Fast Randomized AlgorithmFast Randomized Algorithmfor Finding Silhouettesfor Finding Silhouettes

Silhouette edges form closed curves on 3D model space.Silhouette edges form closed curves on 3D model space.Algorithm:Algorithm:–– Weight all the edges according to:Weight all the edges according to:

dihedral angle.dihedral angle.Being silhouette edges in previous frame.Being silhouette edges in previous frame.

–– Choose a small fraction of edges Choose a small fraction of edges randomlyrandomly according to the according to the weight.weight.

–– If find a silhouette edge, trace out the entire silhouette curveIf find a silhouette edge, trace out the entire silhouette curve..

Page 39: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Fast Randomized AlgorithmFast Randomized Algorithmfor Finding Silhouettesfor Finding Silhouettes

Silhouette edges form closed curves on 3D model space.Silhouette edges form closed curves on 3D model space.Algorithm:Algorithm:–– Weight all the edges according to:Weight all the edges according to:

dihedral angle.dihedral angle.Being silhouette edges in previous frame.Being silhouette edges in previous frame.

–– Choose a small fraction of edges Choose a small fraction of edges randomlyrandomly according to the according to the weight.weight.

–– If find a silhouette edge, trace out the entire silhouette curveIf find a silhouette edge, trace out the entire silhouette curve..

This algorithm canThis algorithm can’’t guarantee all the silhouette edges t guarantee all the silhouette edges will be found, but in practice it is extremely efficient and will be found, but in practice it is extremely efficient and effective:effective:–– Tradeoff between accuracy and speed.Tradeoff between accuracy and speed.

Page 40: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Cusp Vertex on SilhouetteCusp Vertex on Silhouette

A complication vertex on silhouette curve is A complication vertex on silhouette curve is cusp cusp vertexvertex if:if:–– Adjacent to 2 silhouette edges, one frontAdjacent to 2 silhouette edges, one front--facing and the other facing and the other

backback--facing.facing.–– Or adjacent to more than 2 silhouette edges,Or adjacent to more than 2 silhouette edges,–– Or adjacent to a border edge.Or adjacent to a border edge.

Page 41: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Cusp Vertex on SilhouetteCusp Vertex on Silhouette

A complication vertex on silhouette curve is A complication vertex on silhouette curve is cusp cusp vertexvertex if:if:–– Adjacent to 2 silhouette edges, one frontAdjacent to 2 silhouette edges, one front--facing and the other facing and the other

backback--facing.facing.–– Or adjacent to more than 2 silhouette edges,Or adjacent to more than 2 silhouette edges,–– Or adjacent to a border edge.Or adjacent to a border edge.

QIQI along a silhouette curve can change at a vertex only along a silhouette curve can change at a vertex only if that vertex is if that vertex is cusp vertexcusp vertex..

Page 42: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Avoiding Ray Tracing (1)Avoiding Ray Tracing (1)Compute the 2D bounding box of all the silhouette Compute the 2D bounding box of all the silhouette curves in image space of current frame.curves in image space of current frame.

The silhouette curves which touch the bounding box The silhouette curves which touch the bounding box dondon’’t need ray tracing.t need ray tracing.–– Touching pointTouching point’’s s QIQI = 0.= 0.

Page 43: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Avoiding Ray Tracing (2)Avoiding Ray Tracing (2)For each connected silhouette curves, choose an For each connected silhouette curves, choose an arbitrary arbitrary base pointbase point and assume its initial QI value = 0.and assume its initial QI value = 0.

Page 44: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Avoiding Ray Tracing (2)Avoiding Ray Tracing (2)For each connected silhouette curves, choose an For each connected silhouette curves, choose an arbitrary arbitrary base pointbase point and assume its initial QI value = 0. and assume its initial QI value = 0. Propagate the initial QI value along each silhouette Propagate the initial QI value along each silhouette curves. curves.

Page 45: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Avoiding Ray Tracing (2)Avoiding Ray Tracing (2)For each connected silhouette curves, choose an For each connected silhouette curves, choose an arbitrary arbitrary base pointbase point and assume its initial QI value = 0. and assume its initial QI value = 0. Propagate the initial QI value along each silhouette Propagate the initial QI value along each silhouette curves. curves. Adjust the initial QI values for the whole silhouette curve Adjust the initial QI values for the whole silhouette curve according to:according to:–– QI >= 0QI >= 0–– Occlusion relationship between the intersection edges from Occlusion relationship between the intersection edges from

different silhouette curves.different silhouette curves.

Page 46: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Avoiding Ray Tracing (2)Avoiding Ray Tracing (2)For each connected silhouette curves, choose an For each connected silhouette curves, choose an arbitrary arbitrary base pointbase point and assume its initial QI value = 0. and assume its initial QI value = 0. Propagate the initial QI value along each silhouette Propagate the initial QI value along each silhouette curves. curves. Adjust the initial QI values for the whole silhouette curve Adjust the initial QI values for the whole silhouette curve according to:according to:–– QI >= 0QI >= 0–– Occlusion relationship between the intersection edges from Occlusion relationship between the intersection edges from

different silhouette curves.different silhouette curves.For some silhouette curves, the minimum value of QI is For some silhouette curves, the minimum value of QI is greater than 0, and then ray tracing is not necessary .greater than 0, and then ray tracing is not necessary .

Page 47: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Effective Ray TracingEffective Ray Tracing

““WalkingWalking”” Algorithm: Algorithm: –– Only work when all objects are in front of camera;Only work when all objects are in front of camera;–– Fast but complex.Fast but complex.

OctreeOctree AlgorithmAlgorithm–– Immersive scene.Immersive scene.

Page 48: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Rendering visible lines (1)Rendering visible lines (1)

A mechanical part

Drawing the lines directly with slight Drawing the lines directly with slight enhancement, such as:enhancement, such as:–– Width;Width;–– Color. Color.

Page 49: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Rendering visible lines (2)Rendering visible lines (2)

HighHigh--resolution resolution ““artisticallyartistically”” perturbed strokes perturbed strokes defined by adding offsets to the lines:defined by adding offsets to the lines:

Mechanical part rendered with sketchy lines

Page 50: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Rendering visible lines (3)Rendering visible lines (3)

TTextureexture--mapped strokes:mapped strokes:

A charcoal-like rendering of terrain with texture-mapped strokes

Page 51: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

PerformancePerformance

Page 52: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

ExtensionsExtensionsThe variation of the algorithm also could help to The variation of the algorithm also could help to fast locate the other features:fast locate the other features:–– Visible crease, border edges;Visible crease, border edges;–– hidden silhouette.hidden silhouette.–– Visible shadow surface.Visible shadow surface.

Page 53: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

More ResultsMore Results

Human figure with expressive outline and shading strokes

Mechanical part with lines in varied styles

Page 54: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Recommended ReadingRecommended Reading

““Hardware Determined Edge FeaturesHardware Determined Edge Features””–– by Morgan McGuire and John F. Hughes;by Morgan McGuire and John F. Hughes;–– Utilization of vertex Utilization of vertex shadershader on GPU.on GPU.–– The most promising technique for realThe most promising technique for real--time feature time feature

edges detection. edges detection.

Page 55: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

More PicturesMore Pictures

Page 56: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

Page 57: Real-Time Non- Photorealistic Rendering › ~cs767 › student_pres › ... · Real-Time Non-Photorealistic Rendering Presented by: Qing Hu LIAO SOCS, McGill Feb 1, 2005. McGill CS767

McGill CS767 Winter 2005McGill CS767 Winter 2005

The EndsThe Ends

Thanks for your patience.Thanks for your patience.

Question?Question?