Changeset 7782 in orxonox.OLD for branches/atmospheric_engine
- Timestamp:
- May 24, 2006, 12:41:23 AM (18 years ago)
- Location:
- branches/atmospheric_engine/src/lib/graphics/effects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.cc
r7768 r7782 71 71 { 72 72 float color = map256[i*256+j]; 73 texture[i][j][0] = color;74 texture[i][j][1] = color;75 texture[i][j][2] = color;73 texture[i][j][0] = (char) color; 74 texture[i][j][1] = (char) color; 75 texture[i][j][2] = (char) color; 76 76 } 77 77 … … 82 82 } */ 83 83 84 unsigned int ID; //Generate an ID for texture binding85 glGenTextures(1, &ID); //Texture binding86 glBindTexture(GL_TEXTURE_2D, ID);87 88 84 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 89 85 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 90 86 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); 91 87 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); 88 89 glGenTextures(1, &texID[0]); //Texture binding 90 glBindTexture(GL_TEXTURE_2D, texID[0]); 92 91 93 92 gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, 256, 256, GL_RGB, GL_UNSIGNED_BYTE, texture); 94 95 93 } 96 94 … … 103 101 void CloudEffect::draw() const 104 102 { 105 glPushAttrib(GL_ENABLE_BIT); 103 //glPushAttrib(GL_ENABLE_BIT); 104 //glMatrixMode(GL_MODELVIEW); 105 106 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 107 108 glPushMatrix(); 106 109 glEnable(GL_TEXTURE_2D); 107 glMatrixMode(GL_MODELVIEW);108 glPushMatrix();109 110 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);111 112 glEnable(GL_TEXTURE_2D);113 110 114 111 //glLoadIdentity(); 112 glBindTexture(GL_TEXTURE_2D, texID[0]); 115 113 116 114 //glMatrixMode(GL_TEXTURE); //Let's move the clouds from left to right … … 121 119 glBegin(GL_QUADS); 122 120 // Front Face 123 glTexCoord2f(0.0f, 0.0f); glVertex3f( -100.0f, -100.0f, 100.0f); // Bottom Left Of The Texture and Quad124 glTexCoord2f(1.0f, 0.0f); glVertex3f( 100.0f, -100.0f, 100.0f); // Bottom Right Of The Texture and Quad125 glTexCoord2f(1.0f, 1.0f); glVertex3f( 100.0f, 100.0f, 100.0f); // Top Right Of The Texture and Quad126 glTexCoord2f(0.0f, 1.0f); glVertex3f( -100.0f, 100.0f, 100.0f); // Top Left Of The Texture and Quad121 glTexCoord2f(0.0f, 0.0f); glVertex3f(20, 20, 60); // Bottom Left Of The Texture and Quad 122 glTexCoord2f(1.0f, 0.0f); glVertex3f(60, 20, 60); // Bottom Right Of The Texture and Quad 123 glTexCoord2f(1.0f, 1.0f); glVertex3f(60, 60, 60); // Top Right Of The Texture and Quad 124 glTexCoord2f(0.0f, 1.0f); glVertex3f(20, 60, 60); // Top Left Of The Texture and Quad 127 125 glEnd(); 128 126 129 127 glPopMatrix(); 130 glPopAttrib();128 //glPopAttrib(); 131 129 132 130 } -
branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.h
r7768 r7782 44 44 void overlapOctaves(float *map32, float *map256); 45 45 void expFilter(float *map); 46 GLuint texID[1]; 47 46 48 }; 47 49
Note: See TracChangeset
for help on using the changeset viewer.