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:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user