Coder Social home page Coder Social logo

forceflow / ooc_svo_builder Goto Github PK

View Code? Open in Web Editor NEW
275.0 275.0 62.0 13.01 MB

Out-Of-Core Construction of Sparse Voxel Octrees - reference implementation

Home Page: http://graphics.cs.kuleuven.be/publications/BLD14OCCSVO/

License: Other

C++ 94.22% Shell 1.23% C 2.08% CMake 2.46%

ooc_svo_builder's Introduction

I'm Jeroen Baert. I write software, mostly for graphics-related applications. I am the developer of libmorton. I'm part of the Nerdland podcast team. I'm most proficient in C/C++, CUDA, Python and Java.

ooc_svo_builder's People

Contributors

allanhasegawa avatar forceflow avatar nieznanysprawiciel avatar nyue avatar prateekchandan avatar weshoke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ooc_svo_builder's Issues

32bits support?

The documentation for the ".octreenodes" files says that "children base address" and "data address" are of type "size_t", then it says it is a 64bit number, and it may not be. In 32bits systems, a "size_t" may be 32bits. Actually, it's the size of an unsigned it.

I tested compiling the code using both 32 bits and 64 bits modes and got different ".octreenodes" for each mode. The main problem is that they are not compatible, and just part of the children nodes are saved. Below I'm posting a hexdump of the start of a file saved running the 32 bit version. As can be seem, a "data address" and a "children base address" both uses 32bits each, followed by 32bits of "child offsets" (it's just 4 children offsets instead of 8). ("ff" are the -1s, I think)

0000000: 0100 0000 0000 0000 ffff ffff 0100 0000  ................
0000010: 0000 0000 ffff ffff 0100 0000 0000 0000  ................
0000020: ffff ffff 0100 0000 0000 0000 ffff ffff  ................
0000030: 0100 0000 0000 0000 ffff ffff 0100 0000  ................

Not sure if it was intentional (32bits aren't actually supported), just reporting.

Also, VOXELDATA_SIZE (line) on my system (Gentoo 64bits, with Clang 3.4) is of size 22bytes, or 176bits. Which is different than 64+64+(8*8)bits, or 24bytes (the size of the "Node" class). Still not sure if its a problem or not. I was looking at the function "writeVoxelData" and thought it was the function saving each node, well, it's late here.

Question - why is octreedata needed

If octree, is the full octree. And it has it's nodes (filled or empty) on many levels, that can represent the actual voxels, for what we need another abstraction, like data?

cannot bind non-const lvalue reference of type ‘uint_fast32_t&...

I am trying to build svo via build_svo_builder.sh on Ubuntu 18.04, but an error occurs:

../src/svo_builder/svo_builder_util.h: In function ‘glm::vec3 mortonToRGB(uint64_t, size_t)’:
../src/svo_builder/svo_builder_util.h:15:40: error: cannot bind non-const lvalue reference of type ‘uint_fast32_t& {aka long unsigned int&}’ to an rvalue of type ‘uint_fast32_t {aka long unsigned int}’
morton3D_64_decode(morton_number,z,y,x);

Could you check the issue and give me some advice, thank you.

findFirstSetBit functions in libmorton don't compile

https://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Other-Builtins.html

— Built-in Function: int __builtin_ffs (unsigned int x)
Returns one plus the index of the least significant 1-bit of x, or if x is zero, returns zero.

The signature returns an int, but the assignment is to an unsigned long *.

https://github.com/Forceflow/ooc_svo_builder/blob/master/src/libs/libmorton/include/morton_common.h#L32

Also, the 64 variant has the identifier name misspelled first_bit_location v. firstbit_location.

Question

I'm actively developing a newer, more modern viewer
It is not optimized for GPU streaming or compact storage

How is it going with that? Why don't use power of gpu?

Lots of partitions leads to hitting file_descriptor limit

Try to voxelize a big model at 8192 resolution with very limited memory (<1024 Mb), and watch how you get a segfault on Win64, probably related to the amount of files which can be open at the same time.

Possible solutions:

  • Look into stdmax setting (but is this cross-platform?)
  • Only open file descriptors of the partition actually has a triangle to write! (should probably do that anyway)

Partition Morton Code Range Swapped In Dimensions

Going off of the name of the arguments for morton3D_64_Decode_LUT_shifted

inline void morton3D_64_Decode_LUT_shifted(const uint_fast64_t morton, uint_fast32_t& x, uint_fast32_t& y, uint_fast32_t& z){

Seems that the wrong parts of the AABB limit vectors are being passed in:

morton3D_64_Decode_LUT_shifted(morton_start, p_bbox_grid.min[2], p_bbox_grid.min[1], p_bbox_grid.min[0]);

Shouldn't this be

morton3D_64_Decode_LUT_shifted(morton_start, p_bbox_grid.min[0], p_bbox_grid.min[1], p_bbox_grid.min[2]);

https://github.com/Forceflow/ooc_svo_builder/blob/master/src/svo_builder/voxelizer.cpp#L146

voxelize_schwarz_method fails for multi partition

char* voxels = new char[(size_t)morton_part];

auto index = morton3D_64_encode(z, y, x); <-- index is always less than morton_part;
as result [index - morton_start] is less than 0 for 2nd partition, where morton_start is > 0
if (voxels[index - morton_start] == FULL_VOXEL) { continue; }

Question - positions of intermediate voxels

Hi! Is there any way for this program to generate the positions of intermediate voxels or do I have to do it myself somehow?

Also, if not, then how should I approach this? Let's say the root node has position (0, 0, 0) and it has 8 children (intermediate nodes). Can I, just now, exactly deduce the positions of those 8 children?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.