- Timestamp:
- Apr 6, 2005, 10:56:40 PM (20 years ago)
- Location:
- orxonox/branches/shadows/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/shadows/src/shadow.cc
r3728 r3737 84 84 glNewList(this->ground_id,GL_COMPILE); 85 85 86 //blabla86 setGround(); 87 87 88 88 glEndList(); … … 130 130 131 131 glColor3f(1,1,1); 132 glReadPixels(0,0,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image); 133 blur(this->image,SIZE); 134 glTexSubImage2D(GL_TEXTURE_2D,0,0,0,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image); 132 133 glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,0,0,SIZE,SIZE); 134 //glReadPixels(0,0,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image); 135 //blur(this->image,SIZE); 136 //glTexSubImage2D(GL_TEXTURE_2D,0,0,0,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image); 135 137 136 138 glDisable(GL_SCISSOR_TEST); … … 170 172 void Shadow::setGround() 171 173 { 172 this->ground_id=glGenLists(1);173 glNewList(this->ground_id,GL_COMPILE);174 175 174 176 glBegin(GL_QUADS); 175 177 for(int i=0;i<100;i+=1) … … 190 192 } 191 193 glEnd(); 192 glEndList();194 193 195 194 196 … … 254 256 { 255 257 float m[16],im[16]; 258 256 259 createShadow(); 257 258 260 //glClearColor(0,0,0,0); 259 261 //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 260 //glMatrixMode(GL_PROJECTION);261 //glLoadIdentity();262 //gluPerspective(45,4.0/3.0,.5,100);263 //glMatrixMode(GL_MODELVIEW);264 //glLoadIdentity();265 266 //gluLookAt(this->cameraPos[0],this->cameraPos[1],this->cameraPos[2],this->playerPos[0],this->playerPos[1],this->playerPos[2],0,0,1);262 glMatrixMode(GL_PROJECTION); 263 glLoadIdentity(); 264 gluPerspective(45,4.0/3.0,.5,100); 265 glMatrixMode(GL_MODELVIEW); 266 glLoadIdentity(); 267 268 267 269 268 270 glEnable(GL_TEXTURE_GEN_S); … … 274 276 glMatrixMode(GL_TEXTURE); 275 277 glLoadIdentity(); 276 glTranslatef( 0.5,0.5,1.0);277 glScalef(0. 5,0.5,1.0);278 glTranslatef(-.5,.5,0); 279 glScalef(0.3,0.3,1.0); 278 280 glOrtho(-1,1,-1,1,-1,1); 279 281 … … 287 289 glCallList(this->ground_id); 288 290 glDisable(GL_BLEND); 291 glDisable(GL_TEXTURE_2D); 289 292 290 293 glLoadIdentity(); -
orxonox/branches/shadows/src/shadow.h
r3728 r3737 43 43 44 44 void blur(unsigned char *in,int size); 45 void createShadow();45 //void createShadow(); 46 46 void m_inverse(const float *m,float *out); 47 47 … … 52 52 ~Shadow(); 53 53 void init(); 54 void createShadow(); 54 55 void draw(); 55 56 void setGround(); -
orxonox/branches/shadows/src/world.cc
r3728 r3737 503 503 } 504 504 glEnd(); 505 shadow->setGround();505 506 506 507 507 // Disable Textures Again, for Performance reasons. … … 527 527 528 528 glEndList(); 529 shadow->init(); 529 530 } 530 531 … … 579 580 { 580 581 // draw entities 582 583 581 584 WorldEntity* entity; 582 585 entity = this->entities->enumerate(); … … 594 597 595 598 glCallList (objectList); 596 599 597 600 598 601 //After calling the list, draw the skysphere 599 602 600 603 glEnable(GL_TEXTURE_2D); 601 604 skysphere->draw(); 602 605 603 606 shadow->draw(); 607 604 608 605 609
Note: See TracChangeset
for help on using the changeset viewer.