1
0
Fork 0

Tweaks relating to texture repeating effects for runways and disabling mipmaps

(experimental).
This commit is contained in:
curt 2000-09-06 00:10:50 +00:00
parent d60f4d4852
commit b48424236b
2 changed files with 8 additions and 1 deletions

View file

@ -41,6 +41,7 @@
// Constructor // Constructor
FGNewMat::FGNewMat ( void ) { FGNewMat::FGNewMat ( void ) {
wrapu = wrapv = 1; wrapu = wrapv = 1;
mipmap = 1;
} }
@ -58,6 +59,7 @@ FGNewMat::FGNewMat ( const string &mat_name, const string &tex_name )
texture_name = tex_name; texture_name = tex_name;
xsize = ysize = 0; xsize = ysize = 0;
wrapu = wrapv = 1; wrapu = wrapv = 1;
mipmap = 1;
alpha = 0; alpha = 0;
ambient[0] = ambient[1] = ambient[2] = ambient[3] = 1.0; ambient[0] = ambient[1] = ambient[2] = ambient[3] = 1.0;
diffuse[0] = diffuse[1] = diffuse[2] = diffuse[3] = 1.0; diffuse[0] = diffuse[1] = diffuse[2] = diffuse[3] = 1.0;
@ -83,7 +85,7 @@ void FGNewMat::build_ssg_state( const string& path,
textured->disable( GL_BLEND ); textured->disable( GL_BLEND );
textured->disable( GL_ALPHA_TEST ); textured->disable( GL_ALPHA_TEST );
textured->setTexture( (char *)tex_file.c_str(), wrapu, wrapv ); textured->setTexture( (char *)tex_file.c_str(), wrapu, wrapv );
cout << "wrap u = " << wrapu << " wrapv = " << wrapv << endl; // cout << "wrap u = " << wrapu << " wrapv = " << wrapv << endl;
textured->enable( GL_COLOR_MATERIAL ); textured->enable( GL_COLOR_MATERIAL );
textured->setColourMaterial( GL_AMBIENT_AND_DIFFUSE ); textured->setColourMaterial( GL_AMBIENT_AND_DIFFUSE );
textured->setMaterial( GL_EMISSION, 0, 0, 0, 1 ); textured->setMaterial( GL_EMISSION, 0, 0, 0, 1 );
@ -202,6 +204,8 @@ operator >> ( istream& in, FGNewMat& m )
in >> token >> m.wrapu; in >> token >> m.wrapu;
} else if ( token == "wrapv" ) { } else if ( token == "wrapv" ) {
in >> token >> m.wrapv; in >> token >> m.wrapv;
} else if ( token == "mipmap" ) {
in >> token >> m.mipmap;
} else if ( token == "ambient" ) { } else if ( token == "ambient" ) {
in >> token >> m.ambient[0] >> m.ambient[1] in >> token >> m.ambient[0] >> m.ambient[1]
>> m.ambient[2] >> m.ambient[3]; >> m.ambient[2] >> m.ambient[3];

View file

@ -76,6 +76,9 @@ private:
// wrap texture? // wrap texture?
int wrapu, wrapv; int wrapu, wrapv;
// use mipmapping?
int mipmap;
// material properties // material properties
sgVec4 ambient, diffuse, specular, emission; sgVec4 ambient, diffuse, specular, emission;