Presentation is loading. Please wait.

Presentation is loading. Please wait.

Real Time Nonphotorealistic Rendering. How to achieve real time NPR? Economy of line: present a lot of information with very few strokes. Silhouettes.

Similar presentations


Presentation on theme: "Real Time Nonphotorealistic Rendering. How to achieve real time NPR? Economy of line: present a lot of information with very few strokes. Silhouettes."— Presentation transcript:

1 Real Time Nonphotorealistic Rendering

2 How to achieve real time NPR? Economy of line: present a lot of information with very few strokes. Silhouettes +creases + minimal shading Rapid identification of silhouette edges. Use interframe coherence. Sacrifice accuracy for speed. Some silhouettes are not drawn.

3 Procedure 1.Determine silhouette curves 2.Determine the visibility of silhouette and feature edges by a modified Appel’s algorithm 3.Render the silhouette and feature edges 4.May add some shading

4 Definition A “front-facing” polygon: A polygon that the dot product of its outward normal and a vector from a point on the polygon to the camera is positive. Otherwise, it is “back-facing”

5 Definition A “silhouette edge” : An edge adjacent to one front-facing and one back-facing polygons. A silhouette edge is “front-facing” if its adjacent face nearest the camera is front facing. Otherwise it is “back-facing.” A “border edge”: An edge adjacent to only one face.

6 Assumption: generic view The multiplicity of the image of the silhouette curves is everywhere one, except at a finite number of points where is it two. These multiplicity=2 points do not coincide with the projection of any vertices Their number is invariant under small changes in viewing direction

7 Appel’s Algorithm QI (Quantitive Invisibility) : count of the number of front-facing polygons between a point on object and the camera. Draw anywhere with QI=0 Procedure: Identify silhouette edges, then determine visibility. First determine the QI at a certain point, then propagate along edges.

8 Observation: The “Complications” of Appel’s Algorithm When traverse an edge, QI changes only when the edge crosses behind a silhouette. Or, QI can also change at vertices. This happens only when the vertex lies on a silhouette edge.

9 Speeding up Appel’s Algorithm Appel’s Algorithm requires exhaustive search to find silhouette. Need to speed up for real time. It is easy once we find one silhouette edge. Just step along silhouette edges to trace out the entire silhouette curve. Examine a small percentage (1%) of edges to find a silhouette.

10 Finding a Silhouette using Frame- To-Frame Coherence A silhouette in previous frame is likely a silhouette edge of current frame. This can be used to increase our chances of finding silhouette edges. Start with a small subset of edges that are silhouette edges in previous frame, Traverse towards (for back-facing silhouette edges) or away (front-facing silhouette edges) from camera, and check if those are silhouette in current frame.

11 Determine Complications Once the silhouette curve is found, determine visibility using QI.

12 Recall: The “Complications” of Appel’s Algorithm When traverse an edge, QI changes only when the edge crosses behind a silhouette. Or, QI can also change at vertices. This happens only when the vertex lies on a silhouette edge.

13 Cusps: Vertices where QI might change. A Cusp is a vertex that satisfies any of the following, 1.It is adjacent to exactly 2 silhouette edges, one front-facing and one back- facing, or 2.It is adjacent to more than 3 silhouette edges 3.It is adjacent to a border edge.

14

15 Testing less vertices Appel’s algorithm requires a local test at every vertex Since we are only propagating QI “along” a silhouette curve, we only test at cusp vertices. This saves a lot of testing.

16 Avoiding Ray Tests Assumption: objects are completely in view of the camera. Hence, any edge that touches the 2D bounding box of the silhouette requires no test – it is automatically visible. Some ray tracing tests can be avoided.

17 Re-ordering Appel’s Algorithm In Appel’s Algorithm, the procedure in determine visibility is, 1.Use a ray test to establish QI at some point on each cluster. (connected silhouettes) 2.Propagate from there to assign QI everywhere.

18 Re-ordering Appel’s Algorithm If the above order is reversed, sometimes we can eliminate ray test all together. Example: if a whole cluster is occluded, then there’s no need to do ray test.

19 Modified Traversal 1.Find a point on an edge very close to a vertex. This is the base point, b. 2.Assign the QI at b to be 0. 3.Record the QI of all other points in cluster as offset from b. 4.If the lowest resulting QI is m<0, then we can increment b by –m. 5.If the edge is between two clusters, adjust/match their QI accordingly.

20 Walking In most cases, all the clusters will be discovered, so no ray test will be needed at all. For the remaining case, an efficient way testing technique called “walking” is used.

21 Rendering Now with visible surface, the rest is rendering. 3 expressive NPR techniques are presented, 1.Drawing the lines with different thickness. 2.Drawing perturbed lines for artistic effect. 3.Rendering (1) wrt occluding faces.

22

23 Perturbing the line To get artistic effect by perturbing the line, first parameterize the line, then add vector offset.

24

25 Stroke as texture map

26 Rendering with respect to layers of occluding surfaces

27 Place shading strokes in the world space, rather than screen space, to maintain temporal coherence. Make lighting to be point light from camera position. Even distribution of strokes produces higher apparent dentities in regions slanting away from the light. Assign one stroke particle to each triangle, direction is the cross product ofsurface normal and ray from camera to stroke location. This makes it line up with silhouette.

28 Shading strokes


Download ppt "Real Time Nonphotorealistic Rendering. How to achieve real time NPR? Economy of line: present a lot of information with very few strokes. Silhouettes."

Similar presentations


Ads by Google