Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-09-03 05:01:50 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-09-03 05:01:50 +0400
commita5f8298ea5d13d7707bc0cbf0722013276bab9d6 (patch)
tree80e4d6036b0b3150eedd135362bdd6fa8664a17b /source/blender/freestyle/intern/view_map
parent141dd5233ede83a6d3882713c95bba47cee90a68 (diff)
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.
Diffstat (limited to 'source/blender/freestyle/intern/view_map')
-rwxr-xr-xsource/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
index 10d5fb0de75..4cb48d6613e 100755
--- a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
+++ b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
@@ -221,6 +221,7 @@ ViewEdge * ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge) {
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 @@ ViewEdge * ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge) {
// 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