Changeset 3861 in orxonox.OLD for orxonox/branches
- Timestamp:
- Apr 17, 2005, 10:53:00 PM (20 years ago)
- Location:
- orxonox/branches/shadows/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/shadows/src/shadow.cc
r3839 r3861 82 82 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); 83 83 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); 84 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_ CLAMP_TO_EDGE_EXT);85 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_ CLAMP_TO_EDGE_EXT);84 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT); 85 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_REPEAT); 86 86 glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,SIZE,SIZE,0,GL_RGB,GL_UNSIGNED_BYTE,NULL); 87 87 … … 108 108 glBindTexture(GL_TEXTURE_2D,this->shadow_id); 109 109 110 111 float m[16],m2[16]; 112 glClearColor(1,1,1,1); 113 //glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 114 115 glMatrixMode(GL_PROJECTION); 116 glGetFloatv(GL_PROJECTION_MATRIX,m); 117 glLoadIdentity(); 118 glOrtho(-4.2,4.2,-4.2,4.2,-100,100); 119 glMatrixMode(GL_MODELVIEW); 120 glGetFloatv(GL_MODELVIEW_MATRIX,m2); 121 glLoadIdentity(); 110 122 111 123 gluLookAt(this->lightPos[0],this->lightPos[1],this->lightPos[2],this->playerPos[0],this->playerPos[1],this->playerPos[2],0,0,1); … … 121 133 glCallList(this->player_id); 122 134 glEnable(GL_LIGHTING); 123 124 125 126 //glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,0,0,SIZE,SIZE); 127 glReadPixels(0,0,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image); 128 blur(this->image,SIZE); 129 glTexSubImage2D(GL_TEXTURE_2D,0,0,0,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image); 135 glColor3f(1,1,1); 136 137 138 139 glCopyTexSubImage2D(GL_TEXTURE_2D,0,0,0,0,0,SIZE,SIZE); 140 //glReadPixels(0,0,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image); 141 //blur(this->image,SIZE); 142 //glTexSubImage2D(GL_TEXTURE_2D,30,30,30,SIZE,SIZE,GL_RGB,GL_UNSIGNED_BYTE,this->image); 130 143 131 144 glDisable(GL_SCISSOR_TEST); 132 145 glViewport(0,0,1024,768); //Achtung: hier Aufloesung von Orxonox einstellen! 133 134 135 146 147 //Die oben veraenderten und zwischengespeicherten werte wieder herstellen! 148 glMatrixMode(GL_PROJECTION); 149 glLoadIdentity(); 150 glMultMatrixf(m); 151 glMatrixMode(GL_MODELVIEW); 152 glLoadIdentity(); 153 glMultMatrixf(m2); 154 136 155 } 137 156 … … 149 168 //glLoadIdentity(); 150 169 151 this->mat->select();152 glCallList(this->ground_id);153 154 //glDisable(GL_TEXTURE_2D);170 //this->mat->select(); 171 //glCallList(this->ground_id); 172 173 glDisable(GL_TEXTURE_2D); 155 174 175 /*shadow*/ 156 176 glEnable(GL_TEXTURE_GEN_S); 157 177 glEnable(GL_TEXTURE_GEN_T); … … 162 182 glMatrixMode(GL_TEXTURE); 163 183 glLoadIdentity(); 164 //glTranslatef(.5,.5,0);165 //glScalef(.5,.5,1.0);166 //glOrtho(-1,1,-1,1,-1,1);184 glTranslatef(1.5,.5,0); 185 glScalef(.5f,1.0,.5f); 186 glOrtho(-1,1,-1,1,-100,100); 167 187 168 188 gluLookAt(this->lightPos[0],this->lightPos[1],this->lightPos[2],this->playerPos[0],this->playerPos[1],this->playerPos[2],0,0,1); 169 189 170 190 glMultMatrixf(im); 171 glEnable(GL_TEXTURE_2D) ,191 glEnable(GL_TEXTURE_2D); 172 192 glBindTexture(GL_TEXTURE_2D,this->shadow_id); 173 193 glEnable(GL_BLEND); 174 194 glBlendFunc(GL_DST_COLOR,GL_SRC_COLOR); 175 //glCallList(this->ground_id);195 glCallList(this->ground_id); 176 196 glDisable(GL_BLEND); 177 glDisable(GL_TEXTURE_2D);178 179 glLoadIdentity();197 //glDisable(GL_TEXTURE_2D); 198 199 //glLoadIdentity(); 180 200 glMatrixMode(GL_MODELVIEW); 181 201 glDisable(GL_TEXTURE_GEN_S); … … 184 204 glDisable(GL_TEXTURE_GEN_Q); 185 205 186 206 187 207 188 208 -
orxonox/branches/shadows/src/world.cc
r3839 r3861 400 400 401 401 // Initializing the Ground, and loading a Texture into it. 402 Material* boden = new Material("Ground");403 boden->setDiffuseMap("../data/pictures/ground.tga");402 //Material* boden = new Material("Ground"); 403 //boden->setDiffuseMap("../data/pictures/ground.tga"); 404 404 // Setting the illumination mode otherwise it is flat-shaded. 405 boden->setIllum(3);406 boden->select();405 //boden->setIllum(3); 406 //boden->select(); 407 407 int sizeX = 100; 408 408 int sizeZ = 80; … … 579 579 // draw entities 580 580 581 581 582 582 WorldEntity* entity; 583 583 entity = this->entities->enumerate(); … … 595 595 //glLoadIdentity(); 596 596 597 597 shadow->draw(); 598 598 599 599 … … 603 603 604 604 skysphere->draw(); 605 shadow->draw();605 606 606 607 607 … … 691 691 skysphere->updatePosition(localPlayer->absCoordinate.x,localPlayer->absCoordinate.y,localPlayer->absCoordinate.z); 692 692 shadow->updatePosition(localPlayer->absCoordinate.x,localPlayer->absCoordinate.y,localPlayer->absCoordinate.z); 693 693 694 //for( int i = 0; i < tracklen; i++) track[i].tick (seconds); 694 695 }
Note: See TracChangeset
for help on using the changeset viewer.