Created
March 28, 2015 03:07
-
-
Save nickdarnell/5aee92dbb7550e34d916 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MIN_INSIDE_FACES = 4; | |
MIN_INSIDE_PERCENTAGE = 0.03f; | |
int cubemap_sides_seeing_inside = 0; | |
for (int i = 0; i < 6; i++) | |
{ | |
RenderCubeMapSide(i); | |
float backfacePercentage = CalculateBackfacePercentage(i); | |
if (backfacePercentage > MIN_INSIDE_PERCENTAGE) | |
cubemap_sides_seeing_inside++; | |
} | |
if (cubemap_sides_seeing_inside >= MIN_INSIDE_FACES || cubemap_sides_seeing_inside == 0) | |
{ | |
if (cubemap_sides_seeing_inside >= MIN_INSIDE_FACES) | |
cell.Status = CellStatus.Inside; | |
else // cubemap_sides_seeing_inside == 0 | |
cell.Status = CellStatus.Outside; | |
// Propagate cell status... | |
} | |
else | |
{ | |
// Unable to solve status exactly. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment