Skip to content

Commit

Permalink
update engine
Browse files Browse the repository at this point in the history
  • Loading branch information
PZerua committed Oct 23, 2024
1 parent 37c6fd5 commit b049b24
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
38 changes: 19 additions & 19 deletions src/engine/sample_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,25 @@ int SampleEngine::post_initialize()
}

// Create grid
{
MeshInstance3D* grid = new MeshInstance3D();
grid->set_name("Grid");
grid->add_surface(RendererStorage::get_surface("quad"));
grid->set_position(glm::vec3(0.0f));
grid->rotate(glm::radians(90.0f), glm::vec3(1.0f, 0.0f, 0.0f));
grid->scale(glm::vec3(10.f));
grid->set_frustum_culling_enabled(false);

// NOTE: first set the transparency and all types BEFORE loading the shader
Material* grid_material = new Material();
grid_material->set_transparency_type(ALPHA_BLEND);
grid_material->set_cull_type(CULL_NONE);
grid_material->set_type(MATERIAL_UNLIT);
grid_material->set_shader(RendererStorage::get_shader_from_source(shaders::mesh_grid::source, shaders::mesh_grid::path, grid_material));
grid->set_surface_material_override(grid->get_surface(0), grid_material);

main_scene->add_node(grid);
}
//{
// MeshInstance3D* grid = new MeshInstance3D();
// grid->set_name("Grid");
// grid->add_surface(RendererStorage::get_surface("quad"));
// grid->set_position(glm::vec3(0.0f));
// grid->rotate(glm::radians(90.0f), glm::vec3(1.0f, 0.0f, 0.0f));
// grid->scale(glm::vec3(10.f));
// grid->set_frustum_culling_enabled(false);

// // NOTE: first set the transparency and all types BEFORE loading the shader
// Material* grid_material = new Material();
// grid_material->set_transparency_type(ALPHA_BLEND);
// grid_material->set_cull_type(CULL_NONE);
// grid_material->set_type(MATERIAL_UNLIT);
// grid_material->set_shader(RendererStorage::get_shader_from_source(shaders::mesh_grid::source, shaders::mesh_grid::path, grid_material));
// grid->set_surface_material_override(grid->get_surface(0), grid_material);

// main_scene->add_node(grid);
//}

return 0;
}
Expand Down

0 comments on commit b049b24

Please sign in to comment.