mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-21 14:49:19 +02:00
anisotropic filtering support
This commit is contained in:
@@ -130,6 +130,7 @@ bool Global::bAdjustScreenFreq = true;
|
||||
bool Global::bEnableTraction = true;
|
||||
bool Global::bLoadTraction = true;
|
||||
bool Global::bLiveTraction = true;
|
||||
float Global::AnisotropicFiltering = 8.0f; // requested level of anisotropic filtering. TODO: move it to renderer object
|
||||
int Global::iDefaultFiltering = 9; // domyślne rozmywanie tekstur TGA bez alfa
|
||||
int Global::iBallastFiltering = 9; // domyślne rozmywanie tekstur podsypki
|
||||
int Global::iRailProFiltering = 5; // domyślne rozmywanie tekstur szyn
|
||||
@@ -465,7 +466,12 @@ void Global::ConfigParse(cParser &Parser)
|
||||
Parser.getTokens(1, false);
|
||||
Parser >> Global::iDynamicFiltering;
|
||||
}
|
||||
else if (token == "usevbo")
|
||||
else if( token == "anisotropicfiltering" ) {
|
||||
|
||||
Parser.getTokens( 1, false );
|
||||
Parser >> Global::AnisotropicFiltering;
|
||||
}
|
||||
else if( token == "usevbo" )
|
||||
{
|
||||
|
||||
Parser.getTokens();
|
||||
|
||||
@@ -237,6 +237,7 @@ class Global
|
||||
static std::string asSky;
|
||||
static bool bnewAirCouplers;
|
||||
// Ra: nowe zmienne globalne
|
||||
static float AnisotropicFiltering; // requested level of anisotropic filtering. TODO: move it to renderer object
|
||||
static int iDefaultFiltering; // domyślne rozmywanie tekstur TGA
|
||||
static int iBallastFiltering; // domyślne rozmywanie tekstury podsypki
|
||||
static int iRailProFiltering; // domyślne rozmywanie tekstury szyn
|
||||
|
||||
@@ -505,6 +505,11 @@ opengl_texture::set_filtering() {
|
||||
::glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||
::glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
|
||||
|
||||
if( GLEW_EXT_texture_filter_anisotropic ) {
|
||||
// anisotropic filtering
|
||||
::glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, Global::AnisotropicFiltering );
|
||||
}
|
||||
|
||||
bool sharpen{ false };
|
||||
for( auto const &trait : traits ) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user