Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 24, 2005, 7:22:17 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/particleEngine: now particles are transparent, but the loadscreen does not look good anymore

Location:
orxonox/branches/particleEngine/src/lib/graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/particleEngine/src/lib/graphics/importer/material.cc

    r3914 r3946  
    8888 
    8989  // setting the transparency
    90   if (this->transparency == 1.0)
    91     {
    92       glDisable(GL_BLEND);
    93     }
    94   else
     90  if (this->transparency < 1.0)
    9591    {
    9692      glEnable(GL_BLEND);
    9793      glColor4f(1.0f, 1.0f, 1.0f, this->transparency);
    9894      glBlendFunc(GL_SRC_ALPHA, GL_ONE);
     95    }
     96  else
     97    {
     98      glDisable(GL_BLEND);
     99      glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    99100    }
    100101
  • orxonox/branches/particleEngine/src/lib/graphics/importer/texture.cc

    r3905 r3946  
    119119      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
    120120      glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
    121       /*      glTexImage2D(GL_TEXTURE_2D,
     121      glTexImage2D(GL_TEXTURE_2D,
    122122                   0,
    123123                   GL_RGBA,
     
    127127                   GL_UNSIGNED_BYTE,
    128128                   image->pixels);
    129       */
    130       gluBuild2DMipmaps(GL_TEXTURE_2D,
     129     
     130      /*gluBuild2DMipmaps(GL_TEXTURE_2D,
    131131                        3,
    132132                        w,
     
    135135                        GL_UNSIGNED_BYTE,
    136136                        image->pixels);
    137 
     137      */
    138138      SDL_FreeSurface(image); /* No longer needed */
    139139     
  • orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc

    r3945 r3946  
    9696 
    9797  material = new Material("transperencyMap");
    98   material->setDiffuseMap("pictures/radialTransparency.jpg");
    99  
     98  material->setDiffuseMap("pictures/radialTransparency.tga");
     99  //  material->setTransparency(.5);
     100
    100101  glNewList(glID[0], GL_COMPILE);
    101102  glBegin(GL_TRIANGLE_STRIP);
     
    103104  glVertex3f(0.0, .5, .5);
    104105  glTexCoord2f(1, 0);
     106  glVertex3f(0.0, -.5, .5);
     107  glTexCoord2f(0, 1);
    105108  glVertex3f(0.0, .5, -.5);
    106   glTexCoord2f(0, 1);
    107   glVertex3f(0.0, -.5, .5);
    108109  glTexCoord2f(0, 0);
    109110  glVertex3f(0.0, -.5, -.5);
     
    229230
    230231  glMatrixMode(GL_MODELVIEW);
    231  
     232  //  glDisable(GL_LIGHTING);
     233  material->select();
     234  glPushAttrib(GL_ENABLE_BIT);
     235  glDisable(GL_DEPTH_TEST);
     236  glDisable(GL_CULL_FACE);
     237  glDisable(GL_LIGHTING);  // will be set back when leaving 2D-mode
     238  glEnable(GL_TEXTURE_2D);
     239
     240  /* This allows alpha blending of 2D textures with the scene */
     241  glEnable(GL_BLEND);
     242  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     243
     244
    232245  Particle* drawPart = particles;
    233246  if (likely(drawPart != NULL))
     
    248261      glEnd();
    249262    }
     263  glPopAttrib();
     264
    250265}
    251266
Note: See TracChangeset for help on using the changeset viewer.