Commit 6315c513 authored by Andrey Filippov's avatar Andrey Filippov

Fixed far-far objects behind backdrop

parent b36a0561
...@@ -1986,9 +1986,13 @@ public class TexturedModel { ...@@ -1986,9 +1986,13 @@ public class TexturedModel {
boolean [] scan_selected = tileClusters[nslice].getSubSelected(sub_i); // limited to cluster bounds boolean [] scan_selected = tileClusters[nslice].getSubSelected(sub_i); // limited to cluster bounds
int [] scan_border_int = tileClusters[nslice].getSubBorderInt(sub_i); // limited to cluster bounds int [] scan_border_int = tileClusters[nslice].getSubBorderInt(sub_i); // limited to cluster bounds
int max_border = tileClusters[nslice].getBorderIntMax(); int max_border = tileClusters[nslice].getBorderIntMax();
boolean is_sky = tileClusters[nslice].isSky(); boolean is_sky = tileClusters[nslice].isSky(sub_i);
double min_disparity = is_sky? infinity_disparity : min_obj_disparity; double min_disparity = is_sky? infinity_disparity : min_obj_disparity;
if (debugLevel > -2){
System.out.println("nslice="+nslice+" cluster #"+cluster_index+ " is_sky="+is_sky+" min_disparity="+min_disparity);
}
// cluster_index
// skipping averaging disparity for a whole cluster (needs strength and does not seem to be useful) // skipping averaging disparity for a whole cluster (needs strength and does not seem to be useful)
try { try {
if (alpha == null) { if (alpha == null) {
...@@ -2045,7 +2049,7 @@ public class TexturedModel { ...@@ -2045,7 +2049,7 @@ public class TexturedModel {
((dbg_mesh_imgs != null) ? dbg_mesh_imgs[nslice]:null), // double [] tri_img, // ((dbg_mesh_imgs != null) ? dbg_mesh_imgs[nslice]:null), // double [] tri_img, //
dbg_scaled_width, // int tri_img_width, dbg_scaled_width, // int tri_img_width,
// FIXME: make a separate parameter: // FIXME: make a separate parameter:
infinity_disparity, //min_disparity, // infinity_disparity, // 0.25 * clt_parameters.bgnd_range, // 0.3 min_disparity, // infinity_disparity, // min_disparity, // infinity_disparity, // 0.25 * clt_parameters.bgnd_range, // 0.3
clt_parameters.grow_disp_max, // other_range, // 2.0 'other_range - difference from the specified (*_CM) clt_parameters.grow_disp_max, // other_range, // 2.0 'other_range - difference from the specified (*_CM)
clt_parameters.maxDispTriangle, clt_parameters.maxDispTriangle,
clt_parameters.maxZtoXY, // double maxZtoXY, // 10.0. <=0 - do not use clt_parameters.maxZtoXY, // double maxZtoXY, // 10.0. <=0 - do not use
...@@ -3623,7 +3627,7 @@ public class TexturedModel { ...@@ -3623,7 +3627,7 @@ public class TexturedModel {
int sky_slice = -1; int sky_slice = -1;
int sky_subindex = -1; int sky_subindex = -1;
for (int i = 0; i < tileClusters.length; i++) { for (int i = 0; i < tileClusters.length; i++) {
sky_subindex = tileClusters[i].getSkyClusterIndex(); sky_subindex = tileClusters[i].getSkyClusterIndex(); // finds first sky only!
if (sky_subindex >=0) { if (sky_subindex >=0) {
sky_slice = i; sky_slice = i;
break; break;
......
...@@ -96,8 +96,14 @@ class TileCluster{ ...@@ -96,8 +96,14 @@ class TileCluster{
public boolean isSky() { public boolean isSky() {
return is_sky; return is_sky;
} }
public boolean isSky(int sub) {
public int getSkyClusterIndex() { if (clust_list == null) {
return is_sky;
}
return clust_list.get(sub).is_sky;
}
public int getSkyClusterIndex() { // currently (need to fix) there can be multiple sky clusters !
if (clust_list == null) { if (clust_list == null) {
return -2; return -2;
} }
......
...@@ -1489,8 +1489,11 @@ public class TriMesh { ...@@ -1489,8 +1489,11 @@ public class TriMesh {
if (indices[btiley][btilex] != null) { if (indices[btiley][btilex] != null) {
int subdiv = indices[btiley][btilex].length; int subdiv = indices[btiley][btilex].length;
double disp = disparity[tile]; double disp = disparity[tile];
if (disp < min_disparity) disp = min_disparity; if (disp < min_disparity) {
else if (disp > max_disparity) disp = max_disparity; disp = min_disparity;
} else if (disp > max_disparity) {
disp = max_disparity;
}
for (int y = 0; y < indices[btiley][btilex].length; y++) { for (int y = 0; y < indices[btiley][btilex].length; y++) {
for (int x = 0; x < indices[btiley][btilex][y].length; x++) { for (int x = 0; x < indices[btiley][btilex][y].length; x++) {
// TODO - linear interpolate disparity here // TODO - linear interpolate disparity here
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment