Closed OliverEivak closed 7 years ago
Thanks for your thorough bug report, I'll check this out right away. The example you gave, with a "floor" fully filled at 20x20 voxels, definitely shouldn't be having that issue, and there is probably a bug in the conversion from voxel position to pixel position in the image (obviously an image can't have pixels stored in it with negative too-large positions, and I might have missed a check for that). I should probably start making a sample suite of models that I can test against before releasing.
I'm pretty sure this is fully resolved now. There's some repeated code for the different rendering angles, but one (for orthographic directions with a 45-degree slanted camera) was missing some validity checks that are now all accounted for. I'm releasing 0.0.9 now; it also includes another fix (for appearance, not a crash). When you get the chance, can you try 0.0.9 in the releases section? Or you could build IsoVoxel from source if you really feel like it, but it should be the same result. If that release fixes the water.vox issue, feel free to close this issue, or I can once I know I didn't introduce some other bug, heh.
Thanks for the quick response and fix. I tried a couple of models that failed previously and now they are all working :)
Running an automated test over some models sounds good, considering the amount of logic in this application.
Hey, thanks for writing this cool program!
I found that IsoVoxel fails to render some models, for example I created a 20x20x20 voxel file and added one 20x20 layer of blocks on the ground. Trying to render it fails with:
I even ran it through a debugger in Visual Studio, it seems that the outlining code is the culprit, but to be honest that code is not very easy to understand for me :)
I could see that zbuffer was an
int[26624]
and the program was trying to accesszbuffer[i + bmpData.Stride * 2 + 8]
, which withi=26107
andbmpData.Stride=256
would bezbuffer[26627]
.zbuffer
is the size ofnumbytes
and the loop goes fromi=3
tonumbytes - 1
, yet there are places wherezbuffer[i + bmpData.Stride]
and the like are accessed so it must be theargbValues
that should keep the index from getting out of bounds?example.zip