Octree works out to 128x128 as is, and performance seems very promising. Traversal or octree generation fixes will be next

master
MitchellHansen 7 years ago
parent 305ef917e0
commit ed250d1291

@ -4,7 +4,7 @@
#include "util.hpp"
#include <tuple>
#define OCT_DIM 32
#define OCT_DIM 128
struct OctState {

@ -150,20 +150,20 @@ inline std::string read_file(std::string file_name){
inline void PrettyPrintUINT64(uint64_t i, std::stringstream* ss) {
*ss << "[" << std::bitset<15>(i) << "]";
*ss << "[" << std::bitset<1>(i >> 15) << "]";
*ss << "[" << std::bitset<8>(i >> 16) << "]";
*ss << "[" << std::bitset<8>(i >> 24) << "]";
*ss << "[" << std::bitset<32>(i >> 32) << "]\n";
//*ss << "[" << std::bitset<15>(i) << "]";
//*ss << "[" << std::bitset<1>(i >> 15) << "]";
//*ss << "[" << std::bitset<8>(i >> 16) << "]";
//*ss << "[" << std::bitset<8>(i >> 24) << "]";
//*ss << "[" << std::bitset<32>(i >> 32) << "]\n";
}
inline void PrettyPrintUINT64(uint64_t i) {
std::cout << "[" << std::bitset<15>(i) << "]";
std::cout << "[" << std::bitset<1>(i >> 15) << "]";
std::cout << "[" << std::bitset<8>(i >> 16) << "]";
std::cout << "[" << std::bitset<8>(i >> 24) << "]";
std::cout << "[" << std::bitset<32>(i >> 32) << "]" << std::endl;
//std::cout << "[" << std::bitset<15>(i) << "]";
//std::cout << "[" << std::bitset<1>(i >> 15) << "]";
//std::cout << "[" << std::bitset<8>(i >> 16) << "]";
//std::cout << "[" << std::bitset<8>(i >> 24) << "]";
//std::cout << "[" << std::bitset<32>(i >> 32) << "]" << std::endl;
}
inline void DumpLog(std::stringstream* ss, std::string file_name) {

@ -110,7 +110,7 @@ bool get_oct_vox(
parent_stack[parent_stack_position] = head;
// Set our initial dimension and the position at the corner of the oct to keep track of our position
int dimension = 32;
int dimension = 128;
int3 quad_position = (0, 0, 0);
// While we are not at the required resolution
@ -374,7 +374,7 @@ __kernel void raycaster(
// If we hit a voxel
if (voxel.x < 32 && voxel.y < 32 && voxel.z < 32){
if (voxel.x < 128 && voxel.y < 128 && voxel.z < 128){
if (get_oct_vox(
voxel,
octree_descriptor_buffer,

@ -38,7 +38,7 @@ bool Application::init_clcaster() {
// Send the data to the GPU
raycaster->assign_map(map);
octree = std::make_shared<Map>(32, map.get());
octree = std::make_shared<Map>(128, map.get());
raycaster->assign_octree(octree);

@ -12,11 +12,11 @@ Map::Map(uint32_t dimensions, Old_Map* array_map) {
// randomly set the voxel data for testing
for (uint64_t i = 0; i < dimensions * dimensions * dimensions; i++) {
if (rand() % 10000 < 3)
voxel_data[i] = 1;
else
//if (rand() % 10000 < 3)
// voxel_data[i] = 1;
//else
voxel_data[i] = 0;
}
}
char* char_array = array_map->get_voxel_data();
sf::Vector3i arr_dimensions = array_map->getDimensions();

Loading…
Cancel
Save