本文整理汇总了C++中Mat4::get_mat3方法的典型用法代码示例。如果您正苦于以下问题:C++ Mat4::get_mat3方法的具体用法?C++ Mat4::get_mat3怎么用?C++ Mat4::get_mat3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mat4
的用法示例。
在下文中一共展示了Mat4::get_mat3方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update_properties
void ForwardPositonalLightShader::update_properties(
const Mat4& trans,
const RenderEngine& engine) const
{
//TODO remove global camera.
// auto mvp =
set_uniform_matrix4("transformation_mat", trans);
// set_uniform_matrix4("camera_mat", engine.get_global_camera()->get_camera_mat());
// set_uniform_matrix4("projection_mat", engine.get_global_camera()->get_projection_mat());
set_uniform_matrix4("camera_mat", Locator::get_game().get_camera()->get_camera_mat());
set_uniform_matrix4("projection_mat", Locator::get_game().get_camera()->get_projection_mat());
set_uniform_matrix3("normal_mat", trans.get_mat3().inverse().transpose());
set_light("positional_light.light", engine.get_active_light());
set_pos_light("positional_light",static_cast<const PositionalLight*>(engine.get_active_light()),trans);
//
//TODO
set_uniform3f("camera_pos", Locator::get_game().get_camera()->get_world_pos());
set_uniform3f("camera_pos", Locator::get_game().get_camera()->get_world_pos());
set_uniform3f("camera_pos", Locator::get_game().get_camera()->get_world_pos());
set_uniform3f("camera_pos", Locator::get_game().get_camera()->get_world_pos());
// //use the new texture
// material.get_texture("diffuse").bind_texture(m_program_id, m_uniform_map["texture_sampler"]);
}
示例2: update_properties
void ForwardDirectionalShader::update_properties(
const Mat4& trans,
const RenderEngine& engine) const
{
//TOOD use dir
//TODO remove global camera.
// auto mvp =
set_uniform_matrix4("transformation_mat", trans);
// set_uniform_matrix4("camera_mat", engine.get_global_camera()->get_camera_mat());
// set_uniform_matrix4("projection_mat", engine.get_global_camera()->get_projection_mat());
set_uniform_matrix4("camera_mat", Locator::get_game().get_camera()->get_camera_mat());
set_uniform_matrix4("projection_mat", Locator::get_game().get_camera()->get_projection_mat());
set_uniform_matrix3("normal_mat", trans.get_mat3().inverse().transpose());
auto dir_light = static_cast<const DirectionalLight*>(engine.get_active_light());
set_light("directional_light.light", engine.get_active_light());
set_uniform3f("directional_light.direction", dir_light->get_dir());
auto& rim_light = dir_light->get_rim_light();
if (rim_light) {
set_uniformi("directional_light.rim_light.enable", rim_light->get_status());
set_uniform3f("directional_light.rim_light.color", rim_light->get_rim_color());
set_uniformf("directional_light.rim_light.power", rim_light->get_rim_power());
}else{
set_uniformi("directional_light.rim_light.enable", false);
}
//TODO
// set_uniform3f("camera_pos", engine.get_global_camera()->get_world_pos() );
set_uniform3f("camera_pos", Locator::get_game().get_camera()->get_world_pos() );
// //use the new texture
// material.get_texture("diffuse").bind_texture(m_program_id, m_uniform_map["texture_sampler"]);
}