aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llrender/llpostprocess.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llrender/llpostprocess.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/linden/indra/llrender/llpostprocess.cpp b/linden/indra/llrender/llpostprocess.cpp
index c884951..0f1ad5c 100644
--- a/linden/indra/llrender/llpostprocess.cpp
+++ b/linden/indra/llrender/llpostprocess.cpp
@@ -220,9 +220,9 @@ void LLPostProcess::applyColorFilterShader(void)
220 gPostColorFilterProgram.bind(); 220 gPostColorFilterProgram.bind();
221 221
222 gGL.getTexUnit(0)->activate(); 222 gGL.getTexUnit(0)->activate();
223 glEnable(GL_TEXTURE_RECTANGLE_ARB); 223 gGL.getTexUnit(0)->enable(LLTexUnit::TT_RECT_TEXTURE);
224 224
225 glBindTexture(GL_TEXTURE_RECTANGLE_ARB, sceneRenderTexture); 225 gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, sceneRenderTexture);
226 226
227 getShaderUniforms(colorFilterUniforms, gPostColorFilterProgram.mProgramObject); 227 getShaderUniforms(colorFilterUniforms, gPostColorFilterProgram.mProgramObject);
228 glUniform1iARB(colorFilterUniforms["RenderTexture"], 0); 228 glUniform1iARB(colorFilterUniforms["RenderTexture"], 0);
@@ -264,16 +264,16 @@ void LLPostProcess::applyNightVisionShader(void)
264 gPostNightVisionProgram.bind(); 264 gPostNightVisionProgram.bind();
265 265
266 gGL.getTexUnit(0)->activate(); 266 gGL.getTexUnit(0)->activate();
267 glEnable(GL_TEXTURE_RECTANGLE_ARB); 267 gGL.getTexUnit(0)->enable(LLTexUnit::TT_RECT_TEXTURE);
268 268
269 getShaderUniforms(nightVisionUniforms, gPostNightVisionProgram.mProgramObject); 269 getShaderUniforms(nightVisionUniforms, gPostNightVisionProgram.mProgramObject);
270 glBindTexture(GL_TEXTURE_RECTANGLE_ARB, sceneRenderTexture); 270 gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, sceneRenderTexture);
271 glUniform1iARB(nightVisionUniforms["RenderTexture"], 0); 271 glUniform1iARB(nightVisionUniforms["RenderTexture"], 0);
272 272
273 gGL.getTexUnit(1)->activate(); 273 gGL.getTexUnit(1)->activate();
274 glEnable(GL_TEXTURE_2D); 274 gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
275 275
276 glBindTexture(GL_TEXTURE_2D, noiseTexture); 276 gGL.getTexUnit(1)->bindManual(LLTexUnit::TT_TEXTURE, noiseTexture);
277 glUniform1iARB(nightVisionUniforms["NoiseTexture"], 1); 277 glUniform1iARB(nightVisionUniforms["NoiseTexture"], 1);
278 278
279 279
@@ -373,7 +373,7 @@ void LLPostProcess::doEffects(void)
373 373
374void LLPostProcess::copyFrameBuffer(GLuint & texture, unsigned int width, unsigned int height) 374void LLPostProcess::copyFrameBuffer(GLuint & texture, unsigned int width, unsigned int height)
375{ 375{
376 glBindTexture(GL_TEXTURE_RECTANGLE_ARB, texture); 376 gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, texture);
377 glCopyTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, 0, 0, width, height, 0); 377 glCopyTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, 0, 0, width, height, 0);
378} 378}
379 379
@@ -487,7 +487,7 @@ void LLPostProcess::createTexture(GLuint & texture, unsigned int width, unsigned
487 std::vector<GLubyte> data(width * height * 4, 0); 487 std::vector<GLubyte> data(width * height * 4, 0);
488 488
489 glGenTextures(1, &texture); 489 glGenTextures(1, &texture);
490 glBindTexture(GL_TEXTURE_RECTANGLE_ARB, texture); 490 gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, texture);
491 glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, width, height, 0, 491 glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, width, height, 0,
492 GL_RGBA, GL_UNSIGNED_BYTE, &data[0]); 492 GL_RGBA, GL_UNSIGNED_BYTE, &data[0]);
493 glTexParameteri(GL_TEXTURE_RECTANGLE_ARB,GL_TEXTURE_MIN_FILTER,GL_LINEAR); 493 glTexParameteri(GL_TEXTURE_RECTANGLE_ARB,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
@@ -509,7 +509,7 @@ void LLPostProcess::createNoiseTexture(GLuint & texture)
509 buffer[(i * NOISE_SIZE) + k] = (GLubyte)((double) rand() / ((double) RAND_MAX + 1.f) * 255.f); 509 buffer[(i * NOISE_SIZE) + k] = (GLubyte)((double) rand() / ((double) RAND_MAX + 1.f) * 255.f);
510 } 510 }
511 } 511 }
512 glBindTexture(GL_TEXTURE_2D, texture); 512 gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, texture);
513 glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, NOISE_SIZE, NOISE_SIZE, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, &buffer[0]); 513 glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, NOISE_SIZE, NOISE_SIZE, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, &buffer[0]);
514 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_LINEAR); 514 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_LINEAR);
515 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_LINEAR); 515 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,GL_LINEAR);