[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50327] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp: Experimental fix for incorrect view edge visibility.

Tamito Kajiyama rd6t-kjym at asahi-net.or.jp
Mon Sep 3 03:01:57 CEST 2012


Revision: 50327
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50327
Author:   kjym3
Date:     2012-09-03 01:01:50 +0000 (Mon, 03 Sep 2012)
Log Message:
-----------
Experimental fix for incorrect view edge visibility.

The problem is that the visibility of view edges in the view map may be incorrect.
The main cause of this issue is that view edges are constructed from a series of FEdges
without testing the visibility of the FEdges being concatenated.  Later view edges
are split into pieces if two view edges intersect in the 2D image coordinate system.
After that the visibility of the view edges is computed by taking account of occluding
faces in the 3D scene.  In many cases this procedure results in correct line visibility,
but not always (that is the problem).

A simple solution experimentally implemented here is not to chain FEdges at all.
Instead view edges are constructed from at most one FEdge now.  This solution is only
applied to sharp FEdges (roughly corresponding to edges in the input mesh data; specifically,
silhouette, crease, border, edge mark, contour, external contour, and material boundary).

A better solution is to reorder the three steps of view edges construction mentioned above,
i.e., first splitting FEdges at 2D intersection, computing the visibility of the FEdges,
then concatenating them to build view edges.  This solution is left for future work for now.

Modified Paths:
--------------
    branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp

Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp	2012-09-03 00:30:55 UTC (rev 50326)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp	2012-09-03 01:01:50 UTC (rev 50327)
@@ -221,6 +221,7 @@
   OWXEdge previousWEdge = firstWEdge;
   OWXEdge currentWEdge = firstWEdge;
   list<OWXEdge> edgesChain;
+#if 0 /* TK 02-Sep-2012 Experimental fix for incorrect view edge visibility. */
   // bidirectional chaining
   // first direction:
   while(!stopSharpViewEdge(currentWEdge.e)){
@@ -240,6 +241,12 @@
     // Find the previous edge!
     currentWEdge =  FindPreviousWEdge(currentWEdge);
   }
+#else
+  edgesChain.push_back(currentWEdge);
+  ++size;
+  currentWEdge.e->userdata = (void*)1; // processed
+  OWXEdge endWEdge = edgesChain.back();
+#endif
   firstWEdge = edgesChain.front();
 
   // build FEdges




More information about the Bf-blender-cvs mailing list