summaryrefslogtreecommitdiff
path: root/indra/llrender/llpostprocess.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-09-12 11:48:30 -0500
committerDave Parks <davep@lindenlab.com>2022-09-12 11:48:30 -0500
commitc5af5d10edb26d255d0aa2e27eedbbd3f514024e (patch)
tree459dc84efeb2cc75b980b97311dc769b821b021c /indra/llrender/llpostprocess.cpp
parentd7c77e5c64ddfef44b3e47f4c7ae6943ff0e860a (diff)
parent03df9545092cc3917e1c3f947ce2270d0ba31134 (diff)
Merge branch 'DRTVWR-559' of ssh://bitbucket.org/lindenlab/viewer into DRTVWR-559
Diffstat (limited to 'indra/llrender/llpostprocess.cpp')
-rw-r--r--indra/llrender/llpostprocess.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp
index b6ea5aa7f1..74154e5676 100644
--- a/indra/llrender/llpostprocess.cpp
+++ b/indra/llrender/llpostprocess.cpp
@@ -239,17 +239,17 @@ void LLPostProcess::applyColorFilterShader(void)
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, sceneRenderTexture);
getShaderUniforms(colorFilterUniforms, gPostColorFilterProgram.mProgramObject);
- glUniform1iARB(colorFilterUniforms["RenderTexture"], 0);
- glUniform1fARB(colorFilterUniforms["brightness"], tweaks.getBrightness());
- glUniform1fARB(colorFilterUniforms["contrast"], tweaks.getContrast());
+ glUniform1i(colorFilterUniforms["RenderTexture"], 0);
+ glUniform1f(colorFilterUniforms["brightness"], tweaks.getBrightness());
+ glUniform1f(colorFilterUniforms["contrast"], tweaks.getContrast());
float baseI = (tweaks.getContrastBaseR() + tweaks.getContrastBaseG() + tweaks.getContrastBaseB()) / 3.0f;
baseI = tweaks.getContrastBaseIntensity() / ((baseI < 0.001f) ? 0.001f : baseI);
float baseR = tweaks.getContrastBaseR() * baseI;
float baseG = tweaks.getContrastBaseG() * baseI;
float baseB = tweaks.getContrastBaseB() * baseI;
- glUniform3fARB(colorFilterUniforms["contrastBase"], baseR, baseG, baseB);
- glUniform1fARB(colorFilterUniforms["saturation"], tweaks.getSaturation());
- glUniform3fARB(colorFilterUniforms["lumWeights"], LUMINANCE_R, LUMINANCE_G, LUMINANCE_B);
+ glUniform3f(colorFilterUniforms["contrastBase"], baseR, baseG, baseB);
+ glUniform1f(colorFilterUniforms["saturation"], tweaks.getSaturation());
+ glUniform3f(colorFilterUniforms["lumWeights"], LUMINANCE_R, LUMINANCE_G, LUMINANCE_B);
LLGLEnable blend(GL_BLEND);
gGL.setSceneBlendType(LLRender::BT_REPLACE);
@@ -282,22 +282,22 @@ void LLPostProcess::applyNightVisionShader(void)
getShaderUniforms(nightVisionUniforms, gPostNightVisionProgram.mProgramObject);
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, sceneRenderTexture);
- glUniform1iARB(nightVisionUniforms["RenderTexture"], 0);
+ glUniform1i(nightVisionUniforms["RenderTexture"], 0);
gGL.getTexUnit(1)->activate();
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(1)->bindManual(LLTexUnit::TT_TEXTURE, noiseTexture);
- glUniform1iARB(nightVisionUniforms["NoiseTexture"], 1);
+ glUniform1i(nightVisionUniforms["NoiseTexture"], 1);
- glUniform1fARB(nightVisionUniforms["brightMult"], tweaks.getBrightMult());
- glUniform1fARB(nightVisionUniforms["noiseStrength"], tweaks.getNoiseStrength());
+ glUniform1f(nightVisionUniforms["brightMult"], tweaks.getBrightMult());
+ glUniform1f(nightVisionUniforms["noiseStrength"], tweaks.getNoiseStrength());
noiseTextureScale = 0.01f + ((101.f - tweaks.getNoiseSize()) / 100.f);
noiseTextureScale *= (screenH / NOISE_SIZE);
- glUniform3fARB(nightVisionUniforms["lumWeights"], LUMINANCE_R, LUMINANCE_G, LUMINANCE_B);
+ glUniform3f(nightVisionUniforms["lumWeights"], LUMINANCE_R, LUMINANCE_G, LUMINANCE_B);
LLGLEnable blend(GL_BLEND);
gGL.setSceneBlendType(LLRender::BT_REPLACE);
@@ -345,12 +345,12 @@ void LLPostProcess::createBloomShader(void)
bloomBlurUniforms[sBlurWidth] = 0;
}
-void LLPostProcess::getShaderUniforms(glslUniforms & uniforms, GLhandleARB & prog)
+void LLPostProcess::getShaderUniforms(glslUniforms & uniforms, GLuint & prog)
{
/// Find uniform locations and insert into map
glslUniforms::iterator i;
for (i = uniforms.begin(); i != uniforms.end(); ++i){
- i->second = glGetUniformLocationARB(prog, i->first.String().c_str());
+ i->second = glGetUniformLocation(prog, i->first.String().c_str());
}
}
@@ -391,7 +391,7 @@ void LLPostProcess::doEffects(void)
void LLPostProcess::copyFrameBuffer(U32 & texture, unsigned int width, unsigned int height)
{
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, texture);
- glCopyTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, 0, 0, width, height, 0);
+ glCopyTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_RGBA, 0, 0, width, height, 0);
}
void LLPostProcess::drawOrthoQuad(unsigned int width, unsigned int height, QuadType type)
@@ -410,60 +410,60 @@ void LLPostProcess::drawOrthoQuad(unsigned int width, unsigned int height, QuadT
glBegin(GL_QUADS);
if (type != QUAD_BLOOM_EXTRACT){
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.f, (GLfloat) height);
+ glMultiTexCoord2f(GL_TEXTURE0, 0.f, (GLfloat) height);
} else {
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.f, (GLfloat) height * 2.0f);
+ glMultiTexCoord2f(GL_TEXTURE0, 0.f, (GLfloat) height * 2.0f);
}
if (type == QUAD_NOISE){
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB,
+ glMultiTexCoord2f(GL_TEXTURE1,
noiseX,
noiseTextureScale + noiseY);
} else if (type == QUAD_BLOOM_COMBINE){
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.f, (GLfloat) height * 0.5f);
+ glMultiTexCoord2f(GL_TEXTURE1, 0.f, (GLfloat) height * 0.5f);
}
glVertex2f(0.f, (GLfloat) screenH - height);
if (type != QUAD_BLOOM_EXTRACT){
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.f, 0.f);
+ glMultiTexCoord2f(GL_TEXTURE0, 0.f, 0.f);
} else {
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.f, 0.f);
+ glMultiTexCoord2f(GL_TEXTURE0, 0.f, 0.f);
}
if (type == QUAD_NOISE){
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB,
+ glMultiTexCoord2f(GL_TEXTURE1,
noiseX,
noiseY);
} else if (type == QUAD_BLOOM_COMBINE){
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.f, 0.f);
+ glMultiTexCoord2f(GL_TEXTURE1, 0.f, 0.f);
}
glVertex2f(0.f, (GLfloat) height + (screenH - height));
if (type != QUAD_BLOOM_EXTRACT){
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB, (GLfloat) width, 0.f);
+ glMultiTexCoord2f(GL_TEXTURE0, (GLfloat) width, 0.f);
} else {
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB, (GLfloat) width * 2.0f, 0.f);
+ glMultiTexCoord2f(GL_TEXTURE0, (GLfloat) width * 2.0f, 0.f);
}
if (type == QUAD_NOISE){
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB,
+ glMultiTexCoord2f(GL_TEXTURE1,
screenRatio * noiseTextureScale + noiseX,
noiseY);
} else if (type == QUAD_BLOOM_COMBINE){
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, (GLfloat) width * 0.5f, 0.f);
+ glMultiTexCoord2f(GL_TEXTURE1, (GLfloat) width * 0.5f, 0.f);
}
glVertex2f((GLfloat) width, (GLfloat) height + (screenH - height));
if (type != QUAD_BLOOM_EXTRACT){
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB, (GLfloat) width, (GLfloat) height);
+ glMultiTexCoord2f(GL_TEXTURE0, (GLfloat) width, (GLfloat) height);
} else {
- glMultiTexCoord2fARB(GL_TEXTURE0_ARB, (GLfloat) width * 2.0f, (GLfloat) height * 2.0f);
+ glMultiTexCoord2f(GL_TEXTURE0, (GLfloat) width * 2.0f, (GLfloat) height * 2.0f);
}
if (type == QUAD_NOISE){
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB,
+ glMultiTexCoord2f(GL_TEXTURE1,
screenRatio * noiseTextureScale + noiseX,
noiseTextureScale + noiseY);
} else if (type == QUAD_BLOOM_COMBINE){
- glMultiTexCoord2fARB(GL_TEXTURE1_ARB, (GLfloat) width * 0.5f, (GLfloat) height * 0.5f);
+ glMultiTexCoord2f(GL_TEXTURE1, (GLfloat) width * 0.5f, (GLfloat) height * 0.5f);
}
glVertex2f((GLfloat) width, (GLfloat) screenH - height);
glEnd();
@@ -503,7 +503,7 @@ void LLPostProcess::createTexture(LLPointer<LLImageGL>& texture, unsigned int wi
if(texture->createGLTexture())
{
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, texture->getTexName());
- glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 4, width, height, 0,
+ glTexImage2D(GL_TEXTURE_RECTANGLE, 0, 4, width, height, 0,
GL_RGBA, GL_UNSIGNED_BYTE, &data[0]);
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_BILINEAR);
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_CLAMP);
@@ -557,7 +557,7 @@ bool LLPostProcess::checkError(void)
return retCode;
}
-void LLPostProcess::checkShaderError(GLhandleARB shader)
+void LLPostProcess::checkShaderError(GLuint shader)
{
GLint infologLength = 0;
GLint charsWritten = 0;
@@ -565,7 +565,7 @@ void LLPostProcess::checkShaderError(GLhandleARB shader)
checkError(); // Check for OpenGL errors
- glGetObjectParameterivARB(shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &infologLength);
+ glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infologLength);
checkError(); // Check for OpenGL errors
@@ -577,7 +577,7 @@ void LLPostProcess::checkShaderError(GLhandleARB shader)
/// Could not allocate infolog buffer
return;
}
- glGetInfoLogARB(shader, infologLength, &charsWritten, infoLog);
+ glGetProgramInfoLog(shader, infologLength, &charsWritten, infoLog);
// shaderErrorLog << (char *) infoLog << std::endl;
mShaderErrorString = (char *) infoLog;
free(infoLog);