It's time to do the voxel traversal. Going to need to come up with a linear algorithm that doesn't take forever

This commit is contained in:
MitchellHansen
2017-02-13 22:33:48 -08:00
parent 6c368183e9
commit 91e9de347e
4 changed files with 30 additions and 20 deletions

View File

@@ -176,7 +176,7 @@ void Map::generate_octree() {
a.print_block(0);
a.get_voxel(sf::Vector2i(0, 0));
}
void Map::load_unload(sf::Vector3i world_position) {

View File

@@ -91,7 +91,7 @@ int main() {
_map.generate_octree();
// =============================
return 0;
/*GL_Testing t;
t.compile_shader("../shaders/passthrough.frag", GL_Testing::Shader_Type::FRAGMENT);

View File

@@ -109,8 +109,7 @@ void Hardware_Caster::create_texture_atlas(sf::Texture *t, sf::Vector2i tile_dim
create_buffer("tile_dim", sizeof(sf::Vector2i), &tile_dim);
}
void Hardware_Caster::compute()
{
void Hardware_Caster::compute() {
// correlating work size with texture size? good, bad?
run_kernel("raycaster", viewport_texture.getSize().x * viewport_texture.getSize().y);
}
@@ -196,20 +195,6 @@ void Hardware_Caster::create_viewport(int width, int height, float v_fov, float
}
//void Hardware_Caster::assign_lights(std::vector<LightController> *lights) {
//
// //this->lights = ;
//
// std::cout << sizeof(LightController);
// std::cout << sizeof(float);
// light_count = static_cast<int>(lights->size());
//
// //create_buffer("lights", sizeof(float) * 10 * light_count, this->lights->data(), CL_MEM_READ_ONLY | CL_MEM_USE_HOST_PTR);
//
// create_buffer("light_count", sizeof(int), &light_count);
//
//}
void Hardware_Caster::assign_lights(std::vector<PackedData> *data) {
// Get a pointer to the packed light data