Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6511 in orxonox.OLD


Ignore:
Timestamp:
Jan 17, 2006, 2:03:02 AM (18 years ago)
Author:
patrick
Message:

network: skybox is now fixed, there is no seam on the border anymore, some more texture work for the stars background

Location:
branches/network/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/graphics/graphics_engine.cc

    r6441 r6511  
    270270    this->hwExtensions = new SubString((char*)glGetString(GL_EXTENSIONS), " \n\t,");
    271271
    272   PRINT(4)("Running on : %s %s %s\n", vendor, renderer, version);
     272  PRINT(4)("Running on : vendor: %s,  renderer: %s,  version:%s\n", vendor, renderer, version);
    273273  PRINT(4)("Extensions:\n");
    274274  if (this->hwExtensions != NULL)
  • branches/network/src/lib/graphics/importer/texture.cc

    r6465 r6511  
    260260  glBindTexture(target, texture);
    261261
    262   glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
     262  glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
     263  glTexParameteri(target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
     264
     265  glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR/*_MIPMAP_LINEAR*/);
    263266  glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    264267
    265 
    266   glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_REPEAT);
    267   glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_REPEAT);
     268  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_PRIORITY, this->priority);
     269
    268270
    269271  /* control the mipmap levels */
    270 //   glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, 5);f
    271 //   glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MAX_LOD, 0);
    272   glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_PRIORITY, this->priority);
     272  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MIN_LOD, 5);
     273  glTexParameterf(GL_TEXTURE_ENV, GL_TEXTURE_MAX_LOD, 0);
    273274
    274275  /* build the Texture  OpenGL V >= 1.1 */
     
    294295    PRINTF(1)("Error while loading texture (mipmap generation), gluBuild2DMipmaps returned %i\n", errorCode);
    295296
    296   glBindTexture(target, 0);
     297
    297298  return texture;
    298299}
  • branches/network/src/world_entities/skybox.cc

    r6500 r6511  
    7272  this->toList(OM_ENVIRON_NOTICK);
    7373  this->size = 100.0;
     74  this->textureSize = 1024.0f;
    7475
    7576  for (int i = 0; i < 6; i++)
     
    205206}
    206207
     208
     209
     210void SkyBox::draw()
     211{
     212  glPushAttrib(GL_LIGHTING_BIT);
     213  glDisable(GL_LIGHTING);
     214  WorldEntity::draw();
     215//   glEnable(GL_LIGHTING);
     216  glPopAttrib();
     217
     218}
     219
     220
    207221/**
    208222 *  rebuilds the SkyBox
     
    223237  model->addVertex (0.5*size, -0.5*size, -0.5*size);
    224238
    225   model->addVertexTexture (0.0, 1.0);
    226   model->addVertexTexture (1.0, 1.0);
    227   model->addVertexTexture (1.0, 0.0);
    228   model->addVertexTexture (0.0, 0.0);
     239//   model->addVertexTexture (0.0, 1.0);
     240//   model->addVertexTexture (1.0, 1.0);
     241//   model->addVertexTexture (1.0, 0.0);
     242//   model->addVertexTexture (0.0, 0.0);
     243
     244  model->addVertexTexture (1.0/this->textureSize, (this->textureSize - 1.0)/this->textureSize);
     245  model->addVertexTexture ((this->textureSize - 1.0)/this->textureSize, (this->textureSize - 1.0)/this->textureSize);
     246  model->addVertexTexture ((this->textureSize - 1.0)/this->textureSize, 1.0/this->textureSize);
     247  model->addVertexTexture (1.0/this->textureSize, 1.0/this->textureSize);
     248
    229249
    230250  model->addVertexNormal (0.0, 0.0, 1.0);
  • branches/network/src/world_entities/skybox.h

    r6470 r6511  
    3333  void postInit();
    3434
     35  virtual void draw();
    3536
    3637  void setSize(float size);
     
    6061
    6162  float           size;            //!< Size of the SkyBox. This should match the frustum maximum range.
     63  float           textureSize;     //!< this is the length of a texture (assumes a square texture)
    6264  char*           textureName;     //!< Name of the Texture
    6365
Note: See TracChangeset for help on using the changeset viewer.