FlatShader.cpp
Go to the documentation of this file.
14 //-------------- FlatShader_Resource ---------------------------------------------------------------------
23 const StringIO< FlatShader::FittingStage >::ValuesType StringIO< FlatShader::FittingStage >::Values =
28 const StringIO< FlatShader::PixelizeStage >::ValuesType StringIO< FlatShader::PixelizeStage >::Values =
35 const StringIO< FlatShader::ResizeStage >::ValuesType StringIO< FlatShader::ResizeStage >::Values =
43 const StringIO< FlatShader::FilteringStage >::ValuesType StringIO< FlatShader::FilteringStage >::Values =
52 //-------------- FlatShader_Subprovider ---------------------------------------------------------------------
53 FlatShader_Subprovider::FlatShader_Subprovider( Instance * inst, VirtualResourceProvider const * ) :
64 void FlatShader_Subprovider::each_resource( std::function< void( ResourcePath const & ) > const & f ) const
74 //-------------- FlatShader ---------------------------------------------------------------------
75 FlatShader::FlatShader( Instance * inst, VirtualResourceProvider const *, FlatShader_Subprovider const *, ResourcePath const & path ) :
125 this->filtering_msdf_pixel_range = this->_shader.GetUniformLocation( "filtering_msdf_pixel_range" );
126 this->filtering_alpha_threshold = this->_shader.GetUniformLocation( "filtering_alpha_threshold" );
199 glUniform4f( this->preblend, preblend_linear.r, preblend_linear.g, preblend_linear.b, preblend.a );
203 glUniformMatrix4fv( this->projection_view_model, 1, GL_FALSE, glm::value_ptr( projection_view_model ) );
205 float4x4 local_to_pixel_space = glm::inverse( camera.pixelizing_projection ) * projection_view_model;
206 glUniformMatrix4fv( this->local_to_pixel_space, 1, GL_FALSE, glm::value_ptr( local_to_pixel_space ) );
208 glUniformMatrix4fv( this->pixel_to_local_space, 1, GL_FALSE, glm::value_ptr( pixel_to_local_space ) );
216 glUniformMatrix4fv( this->local_to_scissor_space, 1, GL_FALSE, glm::value_ptr( local_to_scissor_space ) );
222 screen_space_position = inv( orthogonal_projection ) * projection * view * model * vertex_position
235 glUniform2f( this->pixelize_offset, params.pixelizeOffset.Get().x, params.pixelizeOffset.Get().y );
245 glUniformMatrix4fv( this->color_transform, 1, GL_FALSE, glm::value_ptr( params.colorTransform.Get() ) );