This commit is contained in:
Siana Gearz
2011-02-13 22:01:18 +01:00
25 changed files with 587 additions and 442 deletions

View File

@@ -1,16 +1,11 @@
http://daniel.haxx.se/projects/c-ares/license.html
c-ares license
Copyright 1998 by the Massachusetts Institute of Technology.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, provided that
the above copyright notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting documentation, and that
the name of M.I.T. not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
M.I.T. makes no representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied warranty.
Copyright 1998 by the Massachusetts Institute of Technology.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, provided that
the above copyright notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting documentation, and that
the name of M.I.T. not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.
M.I.T. makes no representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied warranty.

View File

@@ -1,6 +1,6 @@
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2002, Daniel Stenberg, <daniel@haxx.se>.
Copyright (c) 1996 - 2010, Daniel Stenberg, <daniel@haxx.se>.
All rights reserved.
@@ -19,4 +19,3 @@ OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization of the copyright holder.

View File

@@ -42,6 +42,7 @@
#include "apr_poll.h"
#include "llapr.h"
#define CARES_STATICLIB
#include "llares.h"
#if defined(LL_WINDOWS)
@@ -104,7 +105,8 @@ void LLAres::QueryResponder::queryError(int code)
LLAres::LLAres() :
chan_(NULL), mInitSuccess(false)
{
if (ares_init(&chan_) != ARES_SUCCESS)
if (ares_library_init(ARES_LIB_INIT_ALL) != ARES_SUCCESS ||
ares_init(&chan_) != ARES_SUCCESS)
{
llwarns << "Could not succesfully initialize ares!" << llendl;
return;
@@ -468,7 +470,7 @@ bool LLAres::process(U64 timeout)
ll_init_apr();
}
int socks[ARES_GETSOCK_MAXNUM];
ares_socket_t socks[ARES_GETSOCK_MAXNUM];
apr_pollfd_t aprFds[ARES_GETSOCK_MAXNUM];
apr_int32_t nsds = 0;
int nactive = 0;

View File

@@ -69,9 +69,10 @@ hasGamma(false), hasLighting(false), calculatesAtmospherics(false)
//===============================
// LLGLSL Shader implementation
//===============================
LLGLSLShader::LLGLSLShader()
: mProgramObject(0), mShaderLevel(0), mShaderGroup(SG_DEFAULT)
LLGLSLShader::LLGLSLShader(S32 shader_class)
: mProgramObject(0), mShaderClass(shader_class), mShaderLevel(0), mShaderGroup(SG_DEFAULT)
{
LLShaderMgr::getGlobalShaderList().push_back(this);
}
void LLGLSLShader::unload()
@@ -84,17 +85,18 @@ void LLGLSLShader::unload()
if (mProgramObject)
{
GLhandleARB obj[1024];
//Don't do this! Attached objects are already flagged for deletion.
//They will be deleted when no programs have them attached. (deleting a program auto-detaches them!)
/*GLhandleARB obj[1024];
GLsizei count;
glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj);
for (GLsizei i = 0; i < count; i++)
for (GLsizei i = 0; i < count; i++)
{
glDeleteObjectARB(obj[i]);
}
glDeleteObjectARB(mProgramObject);
}*/
if(mProgramObject)
glDeleteObjectARB(mProgramObject);
mProgramObject = 0;
}
@@ -110,12 +112,17 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
llassert_always(!mShaderFiles.empty());
BOOL success = TRUE;
if(mProgramObject) //purge the old program
glDeleteObjectARB(mProgramObject);
// Create program
mProgramObject = glCreateProgramObjectARB();
// Attach existing objects
if (!LLShaderMgr::instance()->attachShaderFeatures(this))
{
if(mProgramObject)
glDeleteObjectARB(mProgramObject);
mProgramObject = 0;
return FALSE;
}
@@ -145,6 +152,10 @@ BOOL LLGLSLShader::createShader(vector<string> * attributes,
}
if( !success )
{
if(mProgramObject)
glDeleteObjectARB(mProgramObject);
mProgramObject = 0;
LL_WARNS("ShaderLoading") << "Failed to link shader: " << mName << LL_ENDL;
// Try again using a lower shader level;

View File

@@ -67,7 +67,7 @@ public:
SG_WATER
};
LLGLSLShader();
LLGLSLShader(S32 shader_class);
void unload();
BOOL createShader(std::vector<std::string> * attributes,
@@ -134,6 +134,7 @@ public:
std::map<GLint, LLVector4> mValue; //lookup map of uniform location to last known value
std::vector<GLint> mTexture;
S32 mActiveTextureChannels;
S32 mShaderClass;
S32 mShaderLevel;
S32 mShaderGroup;
BOOL mUniformsDirty;

View File

@@ -37,6 +37,10 @@
#include "llsdserialize.h"
#include "llrender.h"
#include "lldir.h"
extern LLGLSLShader gPostColorFilterProgram;
extern LLGLSLShader gPostNightVisionProgram;
extern LLGLSLShader gPostGaussianBlurProgram;
LLPostProcess * gPostProcess = NULL;
@@ -60,7 +64,7 @@ LLPostProcess::LLPostProcess(void) :
mNoiseTexture = NULL ;
mTempBloomTexture = NULL ;
/* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender.
/* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender.*/
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME));
LL_DEBUGS2("AppInit", "Shaders") << "Loading PostProcess Effects settings from " << pathName << LL_ENDL;
@@ -96,6 +100,7 @@ LLPostProcess::LLPostProcess(void) :
defaultEffect["bloom_strength"] = 1.5;
/// Color Filter Defaults
defaultEffect["gamma"] = 1.0;
defaultEffect["brightness"] = 1.0;
defaultEffect["contrast"] = 1.0;
defaultEffect["saturation"] = 1.0;
@@ -105,10 +110,12 @@ LLPostProcess::LLPostProcess(void) :
contrastBase.append(1.0);
contrastBase.append(1.0);
contrastBase.append(0.5);
defaultEffect["gauss_blur_passes"] = 2;
}
setSelectedEffect("default");
*/
//*/
}
LLPostProcess::~LLPostProcess(void)
@@ -145,7 +152,7 @@ void LLPostProcess::setSelectedEffect(std::string const & effectName)
void LLPostProcess::saveEffect(std::string const & effectName)
{
/* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender.
/* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender.*/
mAllEffects[effectName] = tweaks;
std::string pathName(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight", XML_FILENAME));
@@ -156,7 +163,7 @@ void LLPostProcess::saveEffect(std::string const & effectName)
LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter();
formatter->format(mAllEffects, effectsXML);
*/
//*/
}
void LLPostProcess::invalidate()
{
@@ -187,6 +194,7 @@ void LLPostProcess::initialize(unsigned int width, unsigned int height)
createNightVisionShader();
createBloomShader();
createColorFilterShader();
createGaussBlurShader();
checkError();
}
@@ -194,50 +202,64 @@ inline bool LLPostProcess::shadersEnabled(void)
{
return (tweaks.useColorFilter().asBoolean() ||
tweaks.useNightVisionShader().asBoolean() ||
tweaks.useBloomShader().asBoolean() );
tweaks.useBloomShader().asBoolean() ||
tweaks.useGaussBlurFilter().asBoolean() );
}
void LLPostProcess::applyShaders(void)
{
if (tweaks.useColorFilter()){
bool copy_buffer = false;
if (tweaks.useColorFilter())
{
applyColorFilterShader();
checkError();
}
if (tweaks.useNightVisionShader()){
copy_buffer = true;
}
if (tweaks.useGaussBlurFilter())
{
/// If any of the above shaders have been called update the frame buffer;
if (tweaks.useColorFilter())
{
U32 tex = mSceneRenderTexture->getTexName() ;
copyFrameBuffer(tex, screenW, screenH);
}
if (copy_buffer)
copyFrameBuffer(mSceneRenderTexture->getTexName(), screenW, screenH);
applyGaussBlurShader();
checkError();
copy_buffer = true;
}
if (tweaks.useNightVisionShader())
{
/// If any of the above shaders have been called update the frame buffer;
if (copy_buffer)
copyFrameBuffer(mSceneRenderTexture->getTexName(), screenW, screenH);
applyNightVisionShader();
checkError();
copy_buffer = true;
}
if (tweaks.useBloomShader()){
if (tweaks.useBloomShader())
{
/// If any of the above shaders have been called update the frame buffer;
if (tweaks.useColorFilter().asBoolean() || tweaks.useNightVisionShader().asBoolean())
{
U32 tex = mSceneRenderTexture->getTexName() ;
copyFrameBuffer(tex, screenW, screenH);
}
if (copy_buffer)
copyFrameBuffer(mSceneRenderTexture->getTexName(), screenW, screenH);
applyBloomShader();
checkError();
copy_buffer = true;
}
}
void LLPostProcess::applyColorFilterShader(void)
{
/* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender.
if(gPostColorFilterProgram.mProgramObject == 0)
return;
/* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender.*/
gPostColorFilterProgram.bind();
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->enable(LLTexUnit::TT_RECT_TEXTURE);
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, sceneRenderTexture);
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, mSceneRenderTexture.get()->getTexName());
getShaderUniforms(colorFilterUniforms, gPostColorFilterProgram.mProgramObject);
glUniform1iARB(colorFilterUniforms["RenderTexture"], 0);
glUniform1fARB(colorFilterUniforms["gamma"], tweaks.getGamma());
glUniform1fARB(colorFilterUniforms["brightness"], tweaks.getBrightness());
glUniform1fARB(colorFilterUniforms["contrast"], tweaks.getContrast());
float baseI = (tweaks.getContrastBaseR() + tweaks.getContrastBaseG() + tweaks.getContrastBaseB()) / 3.0f;
@@ -256,13 +278,14 @@ void LLPostProcess::applyColorFilterShader(void)
/// Draw a screen space quad
drawOrthoQuad(screenW, screenH, QUAD_NORMAL);
gPostColorFilterProgram.unbind();
*/
//*/
}
void LLPostProcess::createColorFilterShader(void)
{
/// Define uniform names
colorFilterUniforms["RenderTexture"] = 0;
colorFilterUniforms["gamma"] = 0;
colorFilterUniforms["brightness"] = 0;
colorFilterUniforms["contrast"] = 0;
colorFilterUniforms["contrastBase"] = 0;
@@ -272,20 +295,22 @@ void LLPostProcess::createColorFilterShader(void)
void LLPostProcess::applyNightVisionShader(void)
{
/* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender.
if(gPostNightVisionProgram.mProgramObject == 0)
return;
/* Do nothing. Needs to be updated to use our current shader system, and to work with the move into llrender.*/
gPostNightVisionProgram.bind();
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->enable(LLTexUnit::TT_RECT_TEXTURE);
getShaderUniforms(nightVisionUniforms, gPostNightVisionProgram.mProgramObject);
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, sceneRenderTexture);
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, mSceneRenderTexture.get()->getTexName());
glUniform1iARB(nightVisionUniforms["RenderTexture"], 0);
gGL.getTexUnit(1)->activate();
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(1)->bindManual(LLTexUnit::TT_TEXTURE, noiseTexture);
gGL.getTexUnit(1)->bindManual(LLTexUnit::TT_TEXTURE, mNoiseTexture.get()->getTexName());
glUniform1iARB(nightVisionUniforms["NoiseTexture"], 1);
@@ -305,7 +330,7 @@ void LLPostProcess::applyNightVisionShader(void)
drawOrthoQuad(screenW, screenH, QUAD_NOISE);
gPostNightVisionProgram.unbind();
gGL.getTexUnit(0)->activate();
*/
//*/
}
void LLPostProcess::createNightVisionShader(void)
@@ -327,7 +352,7 @@ void LLPostProcess::applyBloomShader(void)
void LLPostProcess::createBloomShader(void)
{
createTexture(mTempBloomTexture, unsigned(screenW * 0.5), unsigned(screenH * 0.5));
//createTexture(mTempBloomTexture, unsigned(screenW * 0.5), unsigned(screenH * 0.5));
/// Create Bloom Extract Shader
bloomExtractUniforms["RenderTexture"] = 0;
@@ -343,6 +368,43 @@ void LLPostProcess::createBloomShader(void)
bloomBlurUniforms["blurWidth"] = 0;
}
void LLPostProcess::applyGaussBlurShader(void)
{
int pass_count = tweaks.getGaussBlurPasses();
if(!pass_count || gPostGaussianBlurProgram.mProgramObject == 0)
return;
getShaderUniforms(gaussBlurUniforms, gPostGaussianBlurProgram.mProgramObject);
gPostGaussianBlurProgram.bind();
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->enable(LLTexUnit::TT_RECT_TEXTURE);
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_RECT_TEXTURE, mSceneRenderTexture.get()->getTexName());
LLGLEnable blend(GL_BLEND);
LLGLDepthTest depth(GL_FALSE);
gGL.setSceneBlendType(LLRender::BT_REPLACE);
glUniform1iARB(gaussBlurUniforms["RenderTexture"], 0);
GLint horiz_pass = gaussBlurUniforms["horizontalPass"];
for(int i = 0;i<pass_count;++i)
{
for(int j = 0;j<2;++j)
{
if(i || j)
copyFrameBuffer(mSceneRenderTexture->getTexName(), screenW, screenH);
glUniform1iARB(horiz_pass, j);
drawOrthoQuad(screenW, screenH, QUAD_NORMAL);
}
}
gPostGaussianBlurProgram.unbind();
}
void LLPostProcess::createGaussBlurShader(void)
{
gaussBlurUniforms["RenderTexture"] = 0;
gaussBlurUniforms["horizontalPass"] = 0;
}
void LLPostProcess::getShaderUniforms(glslUniforms & uniforms, GLhandleARB & prog)
{
/// Find uniform locations and insert into map
@@ -360,8 +422,7 @@ void LLPostProcess::doEffects(void)
/// Copy the screen buffer to the render texture
{
U32 tex = mSceneRenderTexture->getTexName() ;
copyFrameBuffer(tex, screenW, screenH);
copyFrameBuffer(mSceneRenderTexture->getTexName(), screenW, screenH);
}
/// Clear the frame buffer.
@@ -386,85 +447,85 @@ void LLPostProcess::doEffects(void)
checkError();
}
void LLPostProcess::copyFrameBuffer(U32 & texture, unsigned int width, unsigned int height)
void LLPostProcess::copyFrameBuffer(LLGLuint 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);
}
inline void InitQuadArray(F32 *arr, const F32 x, const F32 y, const F32 width, const F32 height)
{
//Lower left
*(arr++)=x;
*(arr++)=y;
//Upper left
*(arr++)=x;
*(arr++)=y+height;
//Upper right
*(arr++)=x+width;
*(arr++)=y+height;
//Lower right
*(arr++)=x+width;
*(arr++)=y;
}
void LLPostProcess::drawOrthoQuad(unsigned int width, unsigned int height, QuadType type)
{
#if 0
float noiseX = 0.f;
float noiseY = 0.f;
float screenRatio = 1.0f;
#if 1
//Redid the logic here. Less cases. No longer using immediate mode.
bool second_tex = true;
//Vertex array used for all post-processing effects
static F32 verts[8];
//Texture coord array used for all post-processing effects
static F32 tex0[8];
//Texture coord array used for relevant post processing effects
static F32 tex1[8];
if (type == QUAD_NOISE){
noiseX = ((float) rand() / (float) RAND_MAX);
noiseY = ((float) rand() / (float) RAND_MAX);
screenRatio = (float) width / (float) height;
//Set up vertex array
InitQuadArray(verts, 0.f, 0.f, width, height);
//Set up first texture coords
if(type == QUAD_BLOOM_EXTRACT)
{
InitQuadArray(tex0, 0.f, 0.f, width*2.f, height*2.f);
second_tex = false;
}
else
{
InitQuadArray(tex0, 0.f, 0.f, width, height);
//Set up second texture coords
if( type == QUAD_BLOOM_COMBINE)
InitQuadArray(tex1, 0.f, 0.f, width*.5, height*.5);
else if( type == QUAD_NOISE )
InitQuadArray(tex1, ((float) rand() / (float) RAND_MAX), ((float) rand() / (float) RAND_MAX),
width * noiseTextureScale / height, noiseTextureScale);
else
second_tex = false;
}
//Prepare to render
glEnableClientState( GL_VERTEX_ARRAY );
glVertexPointer(2, GL_FLOAT, sizeof(F32)*2, verts);
if(second_tex) //tex1 setup
{
glClientActiveTextureARB(GL_TEXTURE1);
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
glTexCoordPointer(2, GL_FLOAT, sizeof(F32)*2, tex1);
}
glClientActiveTextureARB(GL_TEXTURE0);
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
glTexCoordPointer(2, GL_FLOAT, sizeof(F32)*2, tex0);
glBegin(GL_QUADS);
if (type != QUAD_BLOOM_EXTRACT){
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.f, (GLfloat) height);
} else {
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.f, (GLfloat) height * 2.0f);
}
if (type == QUAD_NOISE){
glMultiTexCoord2fARB(GL_TEXTURE1_ARB,
noiseX,
noiseTextureScale + noiseY);
} else if (type == QUAD_BLOOM_COMBINE){
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.f, (GLfloat) height * 0.5f);
}
glVertex2f(0.f, (GLfloat) screenH - height);
//Render
glDrawArrays(GL_QUADS, 0, sizeof(verts)/sizeof(verts[0]));
if (type != QUAD_BLOOM_EXTRACT){
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.f, 0.f);
} else {
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.f, 0.f);
}
if (type == QUAD_NOISE){
glMultiTexCoord2fARB(GL_TEXTURE1_ARB,
noiseX,
noiseY);
} else if (type == QUAD_BLOOM_COMBINE){
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.f, 0.f);
}
glVertex2f(0.f, (GLfloat) height + (screenH - height));
if (type != QUAD_BLOOM_EXTRACT){
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, (GLfloat) width, 0.f);
} else {
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, (GLfloat) width * 2.0f, 0.f);
}
if (type == QUAD_NOISE){
glMultiTexCoord2fARB(GL_TEXTURE1_ARB,
screenRatio * noiseTextureScale + noiseX,
noiseY);
} else if (type == QUAD_BLOOM_COMBINE){
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, (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);
} else {
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, (GLfloat) width * 2.0f, (GLfloat) height * 2.0f);
}
if (type == QUAD_NOISE){
glMultiTexCoord2fARB(GL_TEXTURE1_ARB,
screenRatio * noiseTextureScale + noiseX,
noiseTextureScale + noiseY);
} else if (type == QUAD_BLOOM_COMBINE){
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, (GLfloat) width * 0.5f, (GLfloat) height * 0.5f);
}
glVertex2f((GLfloat) width, (GLfloat) screenH - height);
glEnd();
//Cleanup
glDisableClientState( GL_VERTEX_ARRAY );
glDisableClientState( GL_TEXTURE_COORD_ARRAY ); //for tex0
if(second_tex)
{
glClientActiveTextureARB(GL_TEXTURE1);
glDisableClientState( GL_TEXTURE_COORD_ARRAY ); //for tex1
}
#endif
}
@@ -473,7 +534,7 @@ void LLPostProcess::viewOrthogonal(unsigned int width, unsigned int height)
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho( 0.f, (GLdouble) width , (GLdouble) height , 0.f, -1.f, 1.f );
glOrtho( 0.f, (GLdouble) width, 0.f, (GLdouble) height, -1.f, 1.f );
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();

View File

@@ -124,7 +124,10 @@ public:
inline LLSD & useColorFilter() {
return (*this)["enable_color_filter"];
}
inline LLSD & useGaussBlurFilter() {
return (*this)["enable_gauss_blur"];
}
inline F32 getBrightMult() const {
return F32((*this)["brightness_multiplier"].asReal());
@@ -154,6 +157,10 @@ public:
return F32((*this)["bloom_strength"].asReal());
}
inline F32 getGamma() const {
return F32((*this)["gamma"].asReal());
}
inline F32 getBrightness() const {
return F32((*this)["brightness"].asReal());
}
@@ -182,6 +189,9 @@ public:
return F32((*this)["saturation"].asReal());
}
inline LLSD & getGaussBlurPasses() {
return (*this)["gauss_blur_passes"];
}
};
bool initialized;
@@ -230,6 +240,7 @@ private:
glslUniforms bloomExtractUniforms;
glslUniforms bloomBlurUniforms;
glslUniforms colorFilterUniforms;
glslUniforms gaussBlurUniforms;
// the name of currently selected effect in mAllEffects
// invariant: tweaks == mAllEffects[mSelectedEffectName]
@@ -253,10 +264,14 @@ private:
void createColorFilterShader(void);
void applyColorFilterShader(void);
/// Gaussian blur Filter Functions
void createGaussBlurShader(void);
void applyGaussBlurShader(void);
/// OpenGL Helper Functions
void getShaderUniforms(glslUniforms & uniforms, GLhandleARB & prog);
void createTexture(LLPointer<LLImageGL>& texture, unsigned int width, unsigned int height);
void copyFrameBuffer(U32 & texture, unsigned int width, unsigned int height);
void copyFrameBuffer(LLGLuint texture, unsigned int width, unsigned int height);
void createNoiseTexture(LLPointer<LLImageGL>& texture);
bool checkError(void);
void checkShaderError(GLhandleARB shader);

View File

@@ -385,6 +385,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
if (error != GL_NO_ERROR)
{
LL_WARNS("ShaderLoading") << "GL ERROR in glShaderSourceARB: " << error << LL_ENDL;
glDeleteObjectARB(ret); //no longer need handle
}
else
{
@@ -394,6 +395,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
if (error != GL_NO_ERROR)
{
LL_WARNS("ShaderLoading") << "GL ERROR in glCompileShaderARB: " << error << LL_ENDL;
glDeleteObjectARB(ret); //no longer need handle
}
}
}
@@ -413,6 +415,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
//an error occured, print log
LL_WARNS("ShaderLoading") << "GLSL Compilation Error: (" << error << ") in " << filename << LL_ENDL;
dumpObjectLog(ret);
glDeleteObjectARB(ret); //no longer need handle
ret = 0;
}
}

View File

@@ -71,6 +71,9 @@ protected:
// our parameter manager singleton instance
static LLShaderMgr * sInstance;
public:
static void unloadShaderClass(int shader_class);
static std::vector<LLGLSLShader *> &getGlobalShaderList(); //Holds a list of ALL LLGLSLShader objects.
}; //LLShaderMgr
#endif

View File

@@ -457,6 +457,15 @@ void LLScriptLibrary::init()
addFunction(10.f, 0.f, dummy_func, "llGetLinkPrimitiveParams", NULL, "il");
addFunction(10.f, 0.f, dummy_func, "llLinkParticleSystem", NULL, "il");
addFunction(10.f, 0.f, dummy_func, "llSetLinkTextureAnim", NULL, "iiiiifff");
addFunction(10.f, 0.f, dummy_func, "llGetLinkNumberOfSides", "i", "i");
// IDEVO Name lookup calls, see lscript_avatar_names.h
addFunction(10.f, 0.f, dummy_func, "llGetUsername", "s", "k");
addFunction(10.f, 0.f, dummy_func, "llRequestUsername", "k", "k");
addFunction(10.f, 0.f, dummy_func, "llGetDisplayName", "s", "k");
addFunction(10.f, 0.f, dummy_func, "llRequestDisplayName", "k", "k");
// energy, sleep, dummy_func, name, return type, parameters, gods-only
// IF YOU ADD NEW SCRIPT CALLS, YOU MUST PUT THEM AT THE END OF THIS LIST.

View File

@@ -10,6 +10,7 @@ uniform sampler2D diffuseMap;
void main()
{
gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy));
//gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy)); //This should not compile!
gl_FragColor = vec4(1,1,1,texture2D(diffuseMap, gl_TexCoord[0].xy).a * gl_Color.a);
}

View File

@@ -8,24 +8,20 @@
uniform sampler2D diffuseMap;
uniform float glowStrength;
float kern[4] = float[4](.25,.5,.8,1.0); //Initialize the correct (non nVidia cg) way
void main()
{
vec4 col = vec4(0.0, 0.0, 0.0, 0.0);
// ATI compiler falls down on array initialization.
float kern[8];
kern[0] = 0.25; kern[1] = 0.5; kern[2] = 0.8; kern[3] = 1.0;
kern[4] = 1.0; kern[5] = 0.8; kern[6] = 0.5; kern[7] = 0.25;
col += kern[0] * texture2D(diffuseMap, gl_TexCoord[0].xy);
col += kern[1] * texture2D(diffuseMap, gl_TexCoord[1].xy);
col += kern[2] * texture2D(diffuseMap, gl_TexCoord[2].xy);
col += kern[3] * texture2D(diffuseMap, gl_TexCoord[3].xy);
col += kern[4] * texture2D(diffuseMap, gl_TexCoord[0].zw);
col += kern[5] * texture2D(diffuseMap, gl_TexCoord[1].zw);
col += kern[6] * texture2D(diffuseMap, gl_TexCoord[2].zw);
col += kern[7] * texture2D(diffuseMap, gl_TexCoord[3].zw);
col += kern[3] * texture2D(diffuseMap, gl_TexCoord[0].zw);
col += kern[2] * texture2D(diffuseMap, gl_TexCoord[1].zw);
col += kern[1] * texture2D(diffuseMap, gl_TexCoord[2].zw);
col += kern[0] * texture2D(diffuseMap, gl_TexCoord[3].zw);
gl_FragColor = vec4(col.rgb * glowStrength, col.a);
}

View File

@@ -9,21 +9,18 @@ uniform sampler2DRect RenderTexture;
uniform float bloomStrength;
varying vec4 gl_TexCoord[gl_MaxTextureCoords];
float blurWeights[4] = float[4](.05,.1,.2,.3);
void main(void)
{
float blurWeights[7];
blurWeights[0] = 0.05;
blurWeights[1] = 0.1;
blurWeights[2] = 0.2;
blurWeights[3] = 0.3;
blurWeights[4] = 0.2;
blurWeights[5] = 0.1;
blurWeights[6] = 0.05;
vec3 color = vec3(0,0,0);
for (int i = 0; i < 7; i++){
color += vec3(texture2DRect(RenderTexture, gl_TexCoord[i].st)) * blurWeights[i];
}
vec3 color = blurWeights[0] * texture2DRect(RenderTexture, gl_TexCoord[0].st).rgb;
color+= blurWeights[1] * texture2DRect(RenderTexture, gl_TexCoord[1].st).rgb;
color+= blurWeights[2] * texture2DRect(RenderTexture, gl_TexCoord[2].st).rgb;
color+= blurWeights[3] * texture2DRect(RenderTexture, gl_TexCoord[3].st).rgb;
color+= blurWeights[2] * texture2DRect(RenderTexture, gl_TexCoord[4].st).rgb;
color+= blurWeights[1] * texture2DRect(RenderTexture, gl_TexCoord[5].st).rgb;
color+= blurWeights[0] * texture2DRect(RenderTexture, gl_TexCoord[6].st).rgb;
color *= bloomStrength;

View File

@@ -12,12 +12,15 @@ uniform vec3 contrastBase;
uniform float saturation;
uniform vec3 lumWeights;
const float gamma = 2.0;
uniform float gamma;
void main(void)
{
vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st));
/// Apply gamma
color = pow(color, vec3(1.0/gamma));
/// Modulate brightness
color *= brightness;

View File

@@ -0,0 +1,28 @@
uniform sampler2DRect RenderTexture;
uniform int horizontalPass;
uniform float offset[2] = float[2]( 1.3846153846, 3.2307692308 );
uniform float weight[3] = float[3]( 0.2270270270, 0.3162162162, 0.0702702703 );
void main(void)
{
vec4 color = texture2DRect(RenderTexture, gl_TexCoord[0].st)*weight[0];
if(horizontalPass == 1)
{
color += weight[1] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x+offset[0],gl_TexCoord[0].y));
color += weight[1] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x-offset[0],gl_TexCoord[0].y));
color += weight[2] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x+offset[1],gl_TexCoord[0].y));
color += weight[2] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x-offset[1],gl_TexCoord[0].y));
}
else
{
color += weight[1] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y+offset[0]));
color += weight[1] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y-offset[0]));
color += weight[2] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y+offset[1]));
color += weight[2] * texture2DRect(RenderTexture, vec2(gl_TexCoord[0].x,gl_TexCoord[0].y-offset[1]));
}
gl_FragColor = color;
}

View File

@@ -151,6 +151,8 @@
<real>1.5</real>
<key>bloom_width</key>
<real>2.25</real>
<key>gamma</key>
<real>1.0</real>
<key>brightness</key>
<real>1</real>
<key>brightness_multiplier</key>
@@ -170,6 +172,10 @@
<boolean>0</boolean>
<key>enable_night_vision</key>
<boolean>0</boolean>
<key>enable_gauss_blur</key>
<boolean>0</boolean>
<key>gauss_blur_passes</key>
<integer>2</integer>
<key>extract_high</key>
<real>1</real>
<key>extract_low</key>

View File

@@ -53,7 +53,7 @@ LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater(std::string("Post-Proce
/// Color Filter Callbacks
childSetCommitCallback("ColorFilterToggle", &LLFloaterPostProcess::onBoolToggle, (char*)"enable_color_filter");
//childSetCommitCallback("ColorFilterGamma", &LLFloaterPostProcess::onFloatControlMoved, &(gPostProcess->tweaks.gamma()));
childSetCommitCallback("ColorFilterGamma", &LLFloaterPostProcess::onFloatControlMoved, (char*)"gamma");
childSetCommitCallback("ColorFilterBrightness", &LLFloaterPostProcess::onFloatControlMoved, (char*)"brightness");
childSetCommitCallback("ColorFilterSaturation", &LLFloaterPostProcess::onFloatControlMoved, (char*)"saturation");
childSetCommitCallback("ColorFilterContrast", &LLFloaterPostProcess::onFloatControlMoved, (char*)"contrast");
@@ -75,6 +75,10 @@ LLFloaterPostProcess::LLFloaterPostProcess() : LLFloater(std::string("Post-Proce
childSetCommitCallback("BloomSize", &LLFloaterPostProcess::onFloatControlMoved, (char*)"bloom_width");
childSetCommitCallback("BloomStrength", &LLFloaterPostProcess::onFloatControlMoved, (char*)"bloom_strength");
// Gauss Blur Callbacks
childSetCommitCallback("GaussBlurToggle", &LLFloaterPostProcess::onBoolToggle, (char*)"enable_gauss_blur");
childSetCommitCallback("GaussBlurPasses", &LLFloaterPostProcess::onFloatControlMoved, (char*)"gauss_blur_passes");
// Effect loading and saving.
LLComboBox* comboBox = getChild<LLComboBox>("PPEffectsCombo");
childSetAction("PPLoadEffect", &LLFloaterPostProcess::onLoadEffect, comboBox);
@@ -248,7 +252,7 @@ void LLFloaterPostProcess::syncMenu()
/// Sync Color Filter Menu
childSetValue("ColorFilterToggle", gPostProcess->tweaks.useColorFilter());
//childSetValue("ColorFilterGamma", gPostProcess->tweaks.gamma());
childSetValue("ColorFilterGamma", gPostProcess->tweaks.getGamma());
childSetValue("ColorFilterBrightness", gPostProcess->tweaks.brightness());
childSetValue("ColorFilterSaturation", gPostProcess->tweaks.saturation());
childSetValue("ColorFilterContrast", gPostProcess->tweaks.contrast());
@@ -268,4 +272,7 @@ void LLFloaterPostProcess::syncMenu()
childSetValue("BloomExtract", gPostProcess->tweaks.extractLow());
childSetValue("BloomSize", gPostProcess->tweaks.bloomWidth());
childSetValue("BloomStrength", gPostProcess->tweaks.bloomStrength());
childSetValue("GaussBlurToggle", gPostProcess->tweaks.useGaussBlurFilter());
childSetValue("GaussBlurPasses", gPostProcess->tweaks.getGaussBlurPasses());
}

View File

@@ -1004,7 +1004,18 @@ bool idle_startup()
{
gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
}
//Get these logs out of my newview root directory, PLEASE.
if (gHippoGridManager->getCurrentGrid()->isSecondLife())
{
gDirUtilp->setPerAccountChatLogsDir(LLStringUtil::null,
gSavedSettings.getString("FirstName"), gSavedSettings.getString("LastName") );
}
else
{
gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(),
gSavedSettings.getString("FirstName"), gSavedSettings.getString("LastName") );
}
LLFile::mkdir(gDirUtilp->getChatLogsDir());
LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir());

View File

@@ -914,12 +914,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
gPipeline.mScreen.flush();
}
}
/// We copy the frame buffer straight into a texture here,
/// and then display it again with compositor effects.
/// Using render to texture would be faster/better, but I don't have a
/// grasp of their full display stack just yet.
// gPostProcess->apply(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight());
if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender)
{
@@ -933,7 +927,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
{
gFrameStats.start(LLFrameStats::RENDER_UI);
render_ui();
}
}
LLSpatialGroup::sNoDelete = FALSE;
}
@@ -1131,8 +1125,14 @@ void render_ui(F32 zoom_factor, int subfield)
if (to_texture)
{
gPipeline.renderBloom(gSnapshot, zoom_factor, subfield);
gPipeline.mScreen.flush(); //blit, etc.
}
/// We copy the frame buffer straight into a texture here,
/// and then display it again with compositor effects.
/// Using render to texture would be faster/better, but I don't have a
/// grasp of their full display stack just yet.
gPostProcess->apply(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight());
render_hud_elements();
render_hud_attachments();
}

View File

@@ -67,98 +67,72 @@ BOOL LLViewerShaderMgr::sInitialized = FALSE;
LLVector4 gShinyOrigin;
//object shaders
LLGLSLShader gObjectSimpleProgram;
LLGLSLShader gObjectSimpleWaterProgram;
LLGLSLShader gObjectFullbrightProgram;
LLGLSLShader gObjectFullbrightWaterProgram;
// WindLight shader handles
// Make sure WL Sky is the first program
LLGLSLShader gWLSkyProgram(LLViewerShaderMgr::SHADER_WINDLIGHT);
LLGLSLShader gWLCloudProgram(LLViewerShaderMgr::SHADER_WINDLIGHT);
LLGLSLShader gObjectFullbrightShinyProgram;
LLGLSLShader gObjectShinyProgram;
LLGLSLShader gObjectShinyWaterProgram;
//environment shaders
LLGLSLShader gTerrainProgram;
LLGLSLShader gTerrainWaterProgram;
LLGLSLShader gWaterProgram;
LLGLSLShader gUnderWaterProgram;
//interface shaders
LLGLSLShader gHighlightProgram;
//avatar shader handles
LLGLSLShader gAvatarProgram;
LLGLSLShader gAvatarWaterProgram;
LLGLSLShader gAvatarEyeballProgram;
LLGLSLShader gAvatarPickProgram;
// WindLight shader handles
LLGLSLShader gWLSkyProgram;
LLGLSLShader gWLCloudProgram;
// Effects Shaders
LLGLSLShader gGlowProgram;
LLGLSLShader gGlowExtractProgram;
LLGLSLShader gPostColorFilterProgram;
LLGLSLShader gPostNightVisionProgram;
// Deferred rendering shaders
LLGLSLShader gDeferredImpostorProgram;
LLGLSLShader gDeferredWaterProgram;
LLGLSLShader gDeferredDiffuseProgram;
LLGLSLShader gDeferredBumpProgram;
LLGLSLShader gDeferredTerrainProgram;
LLGLSLShader gDeferredTreeProgram;
LLGLSLShader gDeferredAvatarProgram;
LLGLSLShader gDeferredAvatarAlphaProgram;
LLGLSLShader gDeferredLightProgram;
LLGLSLShader gDeferredMultiLightProgram;
LLGLSLShader gDeferredSunProgram;
LLGLSLShader gDeferredBlurLightProgram;
LLGLSLShader gDeferredSoftenProgram;
LLGLSLShader gDeferredShadowProgram;
LLGLSLShader gDeferredAvatarShadowProgram;
LLGLSLShader gDeferredAlphaProgram;
LLGLSLShader gDeferredFullbrightProgram;
//object shaders
LLGLSLShader gObjectSimpleProgram(LLViewerShaderMgr::SHADER_OBJECT);
LLGLSLShader gObjectSimpleWaterProgram(LLViewerShaderMgr::SHADER_OBJECT);
LLGLSLShader gObjectFullbrightProgram(LLViewerShaderMgr::SHADER_OBJECT);
LLGLSLShader gObjectFullbrightWaterProgram(LLViewerShaderMgr::SHADER_OBJECT);
LLGLSLShader gObjectFullbrightShinyProgram(LLViewerShaderMgr::SHADER_OBJECT);
LLGLSLShader gObjectShinyProgram(LLViewerShaderMgr::SHADER_OBJECT);
LLGLSLShader gObjectShinyWaterProgram(LLViewerShaderMgr::SHADER_OBJECT);
//environment shaders
LLGLSLShader gTerrainProgram(LLViewerShaderMgr::SHADER_ENVIRONMENT);
LLGLSLShader gTerrainWaterProgram(LLViewerShaderMgr::SHADER_WATER); //note, water.
LLGLSLShader gWaterProgram(LLViewerShaderMgr::SHADER_WATER);
LLGLSLShader gUnderWaterProgram(LLViewerShaderMgr::SHADER_WATER);
//interface shaders
LLGLSLShader gHighlightProgram(LLViewerShaderMgr::SHADER_INTERFACE); //Not in mShaderList
//avatar shader handles
LLGLSLShader gAvatarProgram(LLViewerShaderMgr::SHADER_AVATAR);
LLGLSLShader gAvatarWaterProgram(LLViewerShaderMgr::SHADER_AVATAR);
LLGLSLShader gAvatarEyeballProgram(LLViewerShaderMgr::SHADER_AVATAR);
LLGLSLShader gAvatarPickProgram(LLViewerShaderMgr::SHADER_AVATAR); //Not in mShaderList
// Effects Shaders
LLGLSLShader gGlowProgram(LLViewerShaderMgr::SHADER_EFFECT); //Not in mShaderList
LLGLSLShader gGlowExtractProgram(LLViewerShaderMgr::SHADER_EFFECT); //Not in mShaderList
LLGLSLShader gPostColorFilterProgram(LLViewerShaderMgr::SHADER_EFFECT); //Not in mShaderList
LLGLSLShader gPostNightVisionProgram(LLViewerShaderMgr::SHADER_EFFECT); //Not in mShaderList
LLGLSLShader gPostGaussianBlurProgram(LLViewerShaderMgr::SHADER_EFFECT); //Not in mShaderList
// Deferred rendering shaders
LLGLSLShader gDeferredImpostorProgram(LLViewerShaderMgr::SHADER_DEFERRED);
LLGLSLShader gDeferredWaterProgram(LLViewerShaderMgr::SHADER_DEFERRED); //calculatesAtmospherics
LLGLSLShader gDeferredDiffuseProgram(LLViewerShaderMgr::SHADER_DEFERRED);//Not in mShaderList
LLGLSLShader gDeferredBumpProgram(LLViewerShaderMgr::SHADER_DEFERRED); //Not in mShaderList
LLGLSLShader gDeferredTerrainProgram(LLViewerShaderMgr::SHADER_DEFERRED);//Not in mShaderList
LLGLSLShader gDeferredTreeProgram(LLViewerShaderMgr::SHADER_DEFERRED); //Not in mShaderList
LLGLSLShader gDeferredAvatarProgram(LLViewerShaderMgr::SHADER_DEFERRED); //Not in mShaderList
LLGLSLShader gDeferredAvatarAlphaProgram(LLViewerShaderMgr::SHADER_DEFERRED); //calculatesAtmospherics
LLGLSLShader gDeferredLightProgram(LLViewerShaderMgr::SHADER_DEFERRED);
LLGLSLShader gDeferredMultiLightProgram(LLViewerShaderMgr::SHADER_DEFERRED);
LLGLSLShader gDeferredSunProgram(LLViewerShaderMgr::SHADER_DEFERRED);
LLGLSLShader gDeferredBlurLightProgram(LLViewerShaderMgr::SHADER_DEFERRED);
LLGLSLShader gDeferredSoftenProgram(LLViewerShaderMgr::SHADER_DEFERRED);
LLGLSLShader gDeferredShadowProgram(LLViewerShaderMgr::SHADER_DEFERRED); //Not in mShaderList
LLGLSLShader gDeferredAvatarShadowProgram(LLViewerShaderMgr::SHADER_DEFERRED);//Not in mShaderList
LLGLSLShader gDeferredAlphaProgram(LLViewerShaderMgr::SHADER_DEFERRED); //calculatesAtmospherics
LLGLSLShader gDeferredFullbrightProgram(LLViewerShaderMgr::SHADER_DEFERRED); //calculatesAtmospherics
//current avatar shader parameter pointer
GLint gAvatarMatrixParam;
LLViewerShaderMgr::LLViewerShaderMgr() :
mVertexShaderLevel(SHADER_COUNT, 0)
{
/// Make sure WL Sky is the first program
mShaderList.push_back(&gWLSkyProgram);
mShaderList.push_back(&gWLCloudProgram);
mShaderList.push_back(&gAvatarProgram);
mShaderList.push_back(&gObjectShinyProgram);
mShaderList.push_back(&gWaterProgram);
mShaderList.push_back(&gAvatarEyeballProgram);
mShaderList.push_back(&gObjectSimpleProgram);
mShaderList.push_back(&gObjectFullbrightProgram);
mShaderList.push_back(&gObjectFullbrightShinyProgram);
mShaderList.push_back(&gTerrainProgram);
mShaderList.push_back(&gTerrainWaterProgram);
mShaderList.push_back(&gObjectSimpleWaterProgram);
mShaderList.push_back(&gObjectFullbrightWaterProgram);
mShaderList.push_back(&gAvatarWaterProgram);
mShaderList.push_back(&gObjectShinyWaterProgram);
mShaderList.push_back(&gUnderWaterProgram);
mShaderList.push_back(&gDeferredSunProgram);
mShaderList.push_back(&gDeferredBlurLightProgram);
mShaderList.push_back(&gDeferredSoftenProgram);
mShaderList.push_back(&gDeferredLightProgram);
mShaderList.push_back(&gDeferredMultiLightProgram);
mShaderList.push_back(&gDeferredAlphaProgram);
mShaderList.push_back(&gDeferredFullbrightProgram);
mShaderList.push_back(&gDeferredWaterProgram);
mShaderList.push_back(&gDeferredAvatarAlphaProgram);
}
{}
LLViewerShaderMgr::~LLViewerShaderMgr()
{
mVertexShaderLevel.clear();
mShaderList.clear();
}
// static
@@ -283,8 +257,6 @@ void LLViewerShaderMgr::setShaders()
{
return;
}
// Make sure the compiled shader map is cleared before we recompile shaders.
mShaderObjects.clear();
initAttribsAndUniforms();
gPipeline.releaseGLBuffers();
@@ -378,12 +350,7 @@ void LLViewerShaderMgr::setShaders()
loadShadersWindLight();
loadShadersEffects();
loadShadersInterface();
// Load max avatar shaders to set the max level
mVertexShaderLevel[SHADER_AVATAR] = 3;
mMaxAvatarShaderLevel = 3;
loadShadersAvatar();
#if 0 && LL_DARWIN // force avatar shaders off for mac
mVertexShaderLevel[SHADER_AVATAR] = 0;
sMaxAvatarShaderLevel = 0;
@@ -436,28 +403,24 @@ void LLViewerShaderMgr::setShaders()
{
gPipeline.mVertexShadersEnabled = FALSE;
gPipeline.mVertexShadersLoaded = 0;
mVertexShaderLevel[SHADER_LIGHTING] = 0;
mVertexShaderLevel[SHADER_INTERFACE] = 0;
mVertexShaderLevel[SHADER_ENVIRONMENT] = 0;
mVertexShaderLevel[SHADER_WATER] = 0;
mVertexShaderLevel[SHADER_OBJECT] = 0;
mVertexShaderLevel[SHADER_EFFECT] = 0;
mVertexShaderLevel[SHADER_WINDLIGHT] = 0;
mVertexShaderLevel[SHADER_AVATAR] = 0;
for (S32 i = 0; i < SHADER_COUNT; i++)
mVertexShaderLevel[i] = 0;
}
//Flag base shader objects for deletion
//Don't worry-- they won't be deleted until no programs refrence them.
std::map<std::string, GLhandleARB>::iterator it = mShaderObjects.begin();
for(it;it!=mShaderObjects.end();++it)
if(it->second)
glDeleteObjectARB(it->second);
mShaderObjects.clear();
}
else
{
gPipeline.mVertexShadersEnabled = FALSE;
gPipeline.mVertexShadersLoaded = 0;
mVertexShaderLevel[SHADER_LIGHTING] = 0;
mVertexShaderLevel[SHADER_INTERFACE] = 0;
mVertexShaderLevel[SHADER_ENVIRONMENT] = 0;
mVertexShaderLevel[SHADER_WATER] = 0;
mVertexShaderLevel[SHADER_OBJECT] = 0;
mVertexShaderLevel[SHADER_EFFECT] = 0;
mVertexShaderLevel[SHADER_WINDLIGHT] = 0;
mVertexShaderLevel[SHADER_AVATAR] = 0;
for (S32 i = 0; i < SHADER_COUNT; i++)
mVertexShaderLevel[i] = 0;
}
if (gViewerWindow)
@@ -469,42 +432,14 @@ void LLViewerShaderMgr::setShaders()
void LLViewerShaderMgr::unloadShaders()
{
gObjectSimpleProgram.unload();
gObjectSimpleWaterProgram.unload();
gObjectFullbrightProgram.unload();
gObjectFullbrightWaterProgram.unload();
//Instead of manually unloading, shaders are now automatically accumulated in a list.
//Simply iterate and unload.
std::vector<LLGLSLShader *> &shader_list = LLShaderMgr::getGlobalShaderList();
for(std::vector<LLGLSLShader *>::iterator it=shader_list.begin();it!=shader_list.end();++it)
(*it)->unload();
gObjectShinyProgram.unload();
gObjectFullbrightShinyProgram.unload();
gObjectShinyWaterProgram.unload();
gWaterProgram.unload();
gUnderWaterProgram.unload();
gTerrainProgram.unload();
gTerrainWaterProgram.unload();
gGlowProgram.unload();
gGlowExtractProgram.unload();
gAvatarProgram.unload();
gAvatarWaterProgram.unload();
gAvatarEyeballProgram.unload();
gAvatarPickProgram.unload();
gHighlightProgram.unload();
gWLSkyProgram.unload();
gWLCloudProgram.unload();
gPostColorFilterProgram.unload();
gPostNightVisionProgram.unload();
gDeferredDiffuseProgram.unload();
mVertexShaderLevel[SHADER_LIGHTING] = 0;
mVertexShaderLevel[SHADER_OBJECT] = 0;
mVertexShaderLevel[SHADER_AVATAR] = 0;
mVertexShaderLevel[SHADER_ENVIRONMENT] = 0;
mVertexShaderLevel[SHADER_WATER] = 0;
mVertexShaderLevel[SHADER_INTERFACE] = 0;
mVertexShaderLevel[SHADER_EFFECT] = 0;
mVertexShaderLevel[SHADER_WINDLIGHT] = 0;
for (S32 i = 0; i < SHADER_COUNT; i++)
mVertexShaderLevel[i] = 0;
gPipeline.mVertexShadersLoaded = 0;
}
@@ -601,7 +536,7 @@ BOOL LLViewerShaderMgr::loadShadersEnvironment()
if (mVertexShaderLevel[SHADER_ENVIRONMENT] == 0)
{
gTerrainProgram.unload();
unloadShaderClass(SHADER_ENVIRONMENT);
return FALSE;
}
@@ -637,9 +572,7 @@ BOOL LLViewerShaderMgr::loadShadersWater()
if (mVertexShaderLevel[SHADER_WATER] == 0)
{
gWaterProgram.unload();
gUnderWaterProgram.unload();
gTerrainWaterProgram.unload();
unloadShaderClass(SHADER_WATER);
return FALSE;
}
@@ -719,47 +652,41 @@ BOOL LLViewerShaderMgr::loadShadersEffects()
if (mVertexShaderLevel[SHADER_EFFECT] == 0)
{
gGlowProgram.unload();
gGlowExtractProgram.unload();
gPostColorFilterProgram.unload();
gPostNightVisionProgram.unload();
unloadShaderClass(SHADER_EFFECT);
return FALSE;
}
if (success)
if(LLPipeline::sRenderGlow)
{
gGlowProgram.mName = "Glow Shader (Post)";
gGlowProgram.mShaderFiles.clear();
gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowV.glsl", GL_VERTEX_SHADER_ARB));
gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowF.glsl", GL_FRAGMENT_SHADER_ARB));
gGlowProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
success = gGlowProgram.createShader(NULL, &mGlowUniforms);
if (!success)
if (success)
{
LLPipeline::sRenderGlow = FALSE;
gGlowProgram.mName = "Glow Shader (Post)";
gGlowProgram.mShaderFiles.clear();
gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowV.glsl", GL_VERTEX_SHADER_ARB));
gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowF.glsl", GL_FRAGMENT_SHADER_ARB));
gGlowProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
success = gGlowProgram.createShader(NULL, &mGlowUniforms);
LLPipeline::sRenderGlow = success;
}
if (success)
{
gGlowExtractProgram.mName = "Glow Extract Shader (Post)";
gGlowExtractProgram.mShaderFiles.clear();
gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractV.glsl", GL_VERTEX_SHADER_ARB));
gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractF.glsl", GL_FRAGMENT_SHADER_ARB));
gGlowExtractProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
success = gGlowExtractProgram.createShader(NULL, &mGlowExtractUniforms);
LLPipeline::sRenderGlow = success;
}
}
if (success)
{
gGlowExtractProgram.mName = "Glow Extract Shader (Post)";
gGlowExtractProgram.mShaderFiles.clear();
gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractV.glsl", GL_VERTEX_SHADER_ARB));
gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractF.glsl", GL_FRAGMENT_SHADER_ARB));
gGlowExtractProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
success = gGlowExtractProgram.createShader(NULL, &mGlowExtractUniforms);
if (!success)
{
LLPipeline::sRenderGlow = FALSE;
}
}
#if 0
#if 1
// disabling loading of postprocess shaders until we fix
// ATI sampler2DRect compatibility.
//load Color Filter Shader
if (success)
//if (success)
{
vector<string> shaderUniforms;
shaderUniforms.reserve(7);
@@ -776,11 +703,11 @@ BOOL LLViewerShaderMgr::loadShadersEffects()
gPostColorFilterProgram.mShaderFiles.push_back(make_pair("effects/colorFilterF.glsl", GL_FRAGMENT_SHADER_ARB));
gPostColorFilterProgram.mShaderFiles.push_back(make_pair("effects/drawQuadV.glsl", GL_VERTEX_SHADER_ARB));
gPostColorFilterProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
success = gPostColorFilterProgram.createShader(NULL, &shaderUniforms);
/*success = */gPostColorFilterProgram.createShader(NULL, &shaderUniforms);
}
//load Night Vision Shader
if (success)
//if (success)
{
vector<string> shaderUniforms;
shaderUniforms.reserve(5);
@@ -795,8 +722,25 @@ BOOL LLViewerShaderMgr::loadShadersEffects()
gPostNightVisionProgram.mShaderFiles.push_back(make_pair("effects/nightVisionF.glsl", GL_FRAGMENT_SHADER_ARB));
gPostNightVisionProgram.mShaderFiles.push_back(make_pair("effects/drawQuadV.glsl", GL_VERTEX_SHADER_ARB));
gPostNightVisionProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
success = gPostNightVisionProgram.createShader(NULL, &shaderUniforms);
/*success = */gPostNightVisionProgram.createShader(NULL, &shaderUniforms);
}
//if (success)
{
vector<string> shaderUniforms;
shaderUniforms.reserve(2);
shaderUniforms.push_back("RenderTexture");
shaderUniforms.push_back("horizontalPass");
gPostGaussianBlurProgram.mName = "Gaussian Blur Shader (Post)";
gPostGaussianBlurProgram.mShaderFiles.clear();
gPostGaussianBlurProgram.mShaderFiles.push_back(make_pair("effects/gaussBlurF.glsl", GL_FRAGMENT_SHADER_ARB));
gPostGaussianBlurProgram.mShaderFiles.push_back(make_pair("effects/drawQuadV.glsl", GL_VERTEX_SHADER_ARB));
gPostGaussianBlurProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT];
/*success = */gPostGaussianBlurProgram.createShader(NULL, &shaderUniforms);
}
#endif
return success;
@@ -807,23 +751,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
{
if (mVertexShaderLevel[SHADER_DEFERRED] == 0)
{
gDeferredTreeProgram.unload();
gDeferredDiffuseProgram.unload();
gDeferredBumpProgram.unload();
gDeferredImpostorProgram.unload();
gDeferredTerrainProgram.unload();
gDeferredLightProgram.unload();
gDeferredMultiLightProgram.unload();
gDeferredSunProgram.unload();
gDeferredBlurLightProgram.unload();
gDeferredSoftenProgram.unload();
gDeferredShadowProgram.unload();
gDeferredAvatarShadowProgram.unload();
gDeferredAvatarProgram.unload();
gDeferredAvatarAlphaProgram.unload();
gDeferredAlphaProgram.unload();
gDeferredFullbrightProgram.unload();
gDeferredWaterProgram.unload();
unloadShaderClass(SHADER_DEFERRED);
return FALSE;
}
@@ -1031,13 +959,7 @@ BOOL LLViewerShaderMgr::loadShadersObject()
if (mVertexShaderLevel[SHADER_OBJECT] == 0)
{
gObjectShinyProgram.unload();
gObjectFullbrightShinyProgram.unload();
gObjectShinyWaterProgram.unload();
gObjectSimpleProgram.unload();
gObjectSimpleWaterProgram.unload();
gObjectFullbrightProgram.unload();
gObjectFullbrightWaterProgram.unload();
unloadShaderClass(SHADER_OBJECT);
return FALSE;
}
@@ -1163,10 +1085,7 @@ BOOL LLViewerShaderMgr::loadShadersAvatar()
if (mVertexShaderLevel[SHADER_AVATAR] == 0)
{
gAvatarProgram.unload();
gAvatarWaterProgram.unload();
gAvatarEyeballProgram.unload();
gAvatarPickProgram.unload();
unloadShaderClass(SHADER_AVATAR);
return FALSE;
}
@@ -1253,7 +1172,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface()
if (mVertexShaderLevel[SHADER_INTERFACE] == 0)
{
gHighlightProgram.unload();
unloadShaderClass(SHADER_INTERFACE);
return FALSE;
}
@@ -1282,8 +1201,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight()
if (mVertexShaderLevel[SHADER_WINDLIGHT] < 2)
{
gWLSkyProgram.unload();
gWLCloudProgram.unload();
unloadShaderClass(SHADER_WINDLIGHT);
return FALSE;
}
@@ -1324,3 +1242,18 @@ void LLViewerShaderMgr::updateShaderUniforms(LLGLSLShader * shader)
LLWLParamManager::instance()->updateShaderUniforms(shader);
LLWaterParamManager::instance()->updateShaderUniforms(shader);
}
/*static*/ void LLShaderMgr::unloadShaderClass(int shader_class)
{
std::vector<LLGLSLShader *> &shader_list = getGlobalShaderList();
for(std::vector<LLGLSLShader *>::iterator it=shader_list.begin();it!=shader_list.end();++it)
{
if((*it)->mShaderClass == shader_class)
(*it)->unload();
}
}
/*static*/ std::vector<LLGLSLShader *> &LLShaderMgr::getGlobalShaderList()
{
static std::vector<LLGLSLShader *> sGlbShaderLst;
return sGlbShaderLst;
}

View File

@@ -227,12 +227,14 @@ public:
shader_iter beginShaders() const
{
return mShaderList.begin();
return getGlobalShaderList().begin();
//return mShaderList.begin();
}
shader_iter endShaders() const
{
return mShaderList.end();
return getGlobalShaderList().end();
//return mShaderList.end();
}
@@ -263,8 +265,10 @@ private:
std::vector<std::string> mAvatarUniforms;
// the list of shaders we need to propagate parameters to.
std::vector<LLGLSLShader *> mShaderList;
// Currently this is replaced with a global list of all shaders
// which isn't quite as efficient. However, if other changes prove
// stable then I will mimic mShaderList on a per-ParamManager basis.
//std::vector<LLGLSLShader *> mShaderList;
}; //LLViewerShaderMgr
inline bool operator == (LLViewerShaderMgr::shader_iter const & a, LLViewerShaderMgr::shader_iter const & b)
@@ -316,6 +320,7 @@ extern LLGLSLShader gWLCloudProgram;
// Post Process Shaders
extern LLGLSLShader gPostColorFilterProgram;
extern LLGLSLShader gPostNightVisionProgram;
extern LLGLSLShader gPostGaussianBlurProgram;
// Deferred rendering shaders
extern LLGLSLShader gDeferredImpostorProgram;

View File

@@ -8,157 +8,188 @@
width="400">
<panel border="true" bottom="-400" follows="left|top|right|bottom" height="400"
label="Color Filter" left="1" mouse_opaque="false"
name="wmiColorFilterPanel" width="398">
<check_box bottom="-20" control_name="wmiColorFilterToggle" follows="left|top"
name="ColorFilterPanel" width="398">
<check_box bottom="-20" control_name="ColorFilterToggle" follows="left|top"
font="SansSerifSmall" height="16" initial_value="false" label="Enable"
left="14" mouse_opaque="true" name="wmiColorFilterToggle" width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
left="14" mouse_opaque="true" name="ColorFilterToggle" width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-20" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="wmiColorFilterBrightnessText" v_pad="0"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="ColorFilterGammaText" v_pad="0"
width="355">
Brightness
</text>
<slider bottom_delta="-30" can_edit_text="false"
control_name="wmiColorFilterBrightness" decimal_digits="2" follows="left"
height="10" increment="0.01" initial_val="1.0" label="" left="14"
max_val="4" min_val="0" mouse_opaque="true" name="wmiColorFilterBrightness"
Gamma
</text>
<slider bottom_delta="-30" can_edit_text="true"
control_name="ColorFilterGamma" decimal_digits="2" follows="left"
height="18" increment="0.01" initial_val="1.0" label="" left="14"
max_val="10" min_val="-.25" mouse_opaque="true" name="ColorFilterGamma"
show_text="true" value="1.0" width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-20" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="wmiColorFilterSaturationText" v_pad="0"
left="10" mouse_opaque="true" name="ColorFilterBrightnessText" v_pad="0"
width="355">
Brightness
</text>
<slider bottom_delta="-30" can_edit_text="true"
control_name="ColorFilterBrightness" decimal_digits="2" follows="left"
height="18" increment="0.01" initial_val="1.0" label="" left="14"
max_val="4" min_val="0" mouse_opaque="true" name="ColorFilterBrightness"
show_text="true" value="1.0" width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-20" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="ColorFilterSaturationText" v_pad="0"
width="355">
Saturation
</text>
<slider bottom_delta="-30" can_edit_text="false"
control_name="wmiColorFilterSaturation" decimal_digits="2" follows="left"
height="10" increment="0.01" initial_val="1.0" label="" left="14"
<slider bottom_delta="-30" can_edit_text="true"
control_name="ColorFilterSaturation" decimal_digits="2" follows="left"
height="18" increment="0.01" initial_val="1.0" label="" left="14"
max_val="2" min_val="-1" mouse_opaque="true"
name="wmiColorFilterSaturation" show_text="true" value="1.0" width="200" />
name="ColorFilterSaturation" show_text="true" value="1.0" width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-20" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="wmiColorFilterContrastText" v_pad="0"
left="10" mouse_opaque="true" name="ColorFilterContrastText" v_pad="0"
width="355">
Contrast
</text>
<slider bottom_delta="-30" can_edit_text="false" control_name="wmiColorFilterContrast"
decimal_digits="2" follows="left" height="10" increment="0.01"
<slider bottom_delta="-30" can_edit_text="true" control_name="ColorFilterContrast"
decimal_digits="2" follows="left" height="18" increment="0.01"
initial_val="1.0" label="" left="14" max_val="4" min_val="0"
mouse_opaque="true" name="wmiColorFilterContrast" show_text="true"
mouse_opaque="true" name="ColorFilterContrast" show_text="true"
value="1.0" width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-20" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="wmiColorFilterBaseText" v_pad="0"
left="10" mouse_opaque="true" name="ColorFilterBaseText" v_pad="0"
width="355">
Contrast Base Color
</text>
<slider bottom_delta="-30" can_edit_text="false" control_name="wmiColorFilterBaseR"
decimal_digits="3" follows="left" height="10" increment="0.01"
<slider bottom_delta="-30" can_edit_text="true" control_name="ColorFilterBaseR"
decimal_digits="3" follows="left" height="18" increment="0.01"
initial_val="1.0" label="R" left="14" max_val="1" min_val="0"
mouse_opaque="true" name="wmiColorFilterBaseR" show_text="true" value="1.0"
mouse_opaque="true" name="ColorFilterBaseR" show_text="true" value="1.0"
width="200" />
<slider bottom_delta="-20" can_edit_text="false" control_name="wmiColorFilterBaseG"
decimal_digits="3" follows="left" height="10" increment="0.01"
<slider bottom_delta="-20" can_edit_text="true" control_name="ColorFilterBaseG"
decimal_digits="3" follows="left" height="18" increment="0.01"
initial_val="1.0" label="G" left="14" max_val="1" min_val="0"
mouse_opaque="true" name="wmiColorFilterBaseG" show_text="true" value="1.0"
mouse_opaque="true" name="ColorFilterBaseG" show_text="true" value="1.0"
width="200" />
<slider bottom_delta="-20" can_edit_text="false" control_name="wmiColorFilterBaseB"
decimal_digits="3" follows="left" height="10" increment="0.01"
<slider bottom_delta="-20" can_edit_text="true" control_name="ColorFilterBaseB"
decimal_digits="3" follows="left" height="18" increment="0.01"
initial_val="1.0" label="B" left="14" max_val="1" min_val="0"
mouse_opaque="true" name="wmiColorFilterBaseB" show_text="true" value="1.0"
mouse_opaque="true" name="ColorFilterBaseB" show_text="true" value="1.0"
width="200" />
<slider bottom_delta="-20" can_edit_text="false" control_name="wmiColorFilterBaseI"
decimal_digits="3" follows="left" height="10" increment="0.01"
<slider bottom_delta="-20" can_edit_text="true" control_name="ColorFilterBaseI"
decimal_digits="3" follows="left" height="18" increment="0.01"
initial_val="0.5" label="I" left="14" max_val="1" min_val="0"
mouse_opaque="true" name="wmiColorFilterBaseI" show_text="true" value="1.0"
mouse_opaque="true" name="ColorFilterBaseI" show_text="true" value="1.0"
width="200" />
</panel>
<panel border="true" bottom="-180" follows="left|top|right|bottom" height="400"
label="Night Vision" left="1" mouse_opaque="false"
name="wmiNightVisionPanel" width="398">
<check_box bottom="-20" control_name="wmiNightVisionToggle" follows="left|top"
label="Gauss Blur" left="1" mouse_opaque="false"
name="GaussBlurPanel" width="398">
<check_box bottom="-20" control_name="GaussBlurToggle" follows="left|top"
font="SansSerifSmall" height="16" initial_value="false" label="Enable"
left="14" mouse_opaque="true" name="wmiNightVisionToggle" width="200" />
left="14" mouse_opaque="true" name="GaussBlurToggle" width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-21" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="wmiNightVisionBrightMultText" v_pad="0"
left="10" mouse_opaque="true" name="GaussBlurPassesText" v_pad="0"
width="355">
Passes to apply
</text>
<slider bottom_delta="-30" can_edit_text="true"
control_name="GaussBlurPasses" decimal_digits="0" follows="left"
height="18" increment="1" initial_val="9" label="" left="14"
max_val="25" min_val="1" mouse_opaque="true"
name="GaussBlurPasses" show_text="true" value="0.7" width="200" />
</panel>
<panel border="true" bottom="-180" follows="left|top|right|bottom" height="400"
label="Night Vision" left="1" mouse_opaque="false"
name="NightVisionPanel" width="398">
<check_box bottom="-20" control_name="NightVisionToggle" follows="left|top"
font="SansSerifSmall" height="16" initial_value="false" label="Enable"
left="14" mouse_opaque="true" name="NightVisionToggle" width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-21" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="NightVisionBrightMultText" v_pad="0"
width="355">
Light Amplification Multiple
</text>
<slider bottom_delta="-30" can_edit_text="false"
control_name="wmiNightVisionBrightMult" decimal_digits="3" follows="left"
height="10" increment="0.01" initial_val="3.0" label="" left="14"
<slider bottom_delta="-30" can_edit_text="true"
control_name="NightVisionBrightMult" decimal_digits="3" follows="left"
height="18" increment="0.01" initial_val="3.0" label="" left="14"
max_val="10" min_val="1" mouse_opaque="true"
name="wmiNightVisionBrightMult" show_text="true" value="0.7" width="200" />
name="NightVisionBrightMult" show_text="true" value="0.7" width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-20" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="wmiNightVisionNoiseSizeText" v_pad="0"
left="10" mouse_opaque="true" name="NightVisionNoiseSizeText" v_pad="0"
width="355">
Noise Size
</text>
<slider bottom_delta="-30" can_edit_text="false" control_name="wmiNightVisionNoiseSize"
decimal_digits="3" follows="left" height="10" increment="0.1"
<slider bottom_delta="-30" can_edit_text="true" control_name="NightVisionNoiseSize"
decimal_digits="3" follows="left" height="18" increment="0.1"
initial_val="1" label="" left="14" max_val="100" min_val="1"
mouse_opaque="true" name="wmiNightVisionNoiseSize" show_text="true"
mouse_opaque="true" name="NightVisionNoiseSize" show_text="true"
value="1.0" width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-20" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="wmiNightVisionNoiseStrengthText"
left="10" mouse_opaque="true" name="NightVisionNoiseStrengthText"
v_pad="0" width="355">
Noise Strength
</text>
<slider bottom_delta="-30" can_edit_text="false"
control_name="wmiNightVisionNoiseStrength" decimal_digits="3"
follows="left" height="10" increment="0.01" initial_val="0.3" label=""
<slider bottom_delta="-30" can_edit_text="true"
control_name="NightVisionNoiseStrength" decimal_digits="3"
follows="left" height="18" increment="0.01" initial_val="0.3" label=""
left="14" max_val="1" min_val="0" mouse_opaque="true"
name="wmiNightVisionNoiseStrength" show_text="true" value="1.0" width="200" />
name="NightVisionNoiseStrength" show_text="true" value="1.0" width="200" />
</panel>
<panel border="true" bottom="-180" follows="left|top|right|bottom" height="400"
label="Bloom" left="1" mouse_opaque="true"
name="wmiBloomPanel" width="398">
<check_box bottom="-20" control_name="wmiBloomToggle" follows="left|top"
name="BloomPanel" width="398">
<check_box bottom="-20" control_name="BloomToggle" follows="left|top"
font="SansSerifSmall" height="16" initial_value="false" label="Enable"
left="14" mouse_opaque="true" name="wmiBloomToggle" width="200" />
left="14" mouse_opaque="true" name="BloomToggle" width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-21" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="wmiBloomExtractText" v_pad="0"
left="10" mouse_opaque="true" name="BloomExtractText" v_pad="0"
width="355">
Luminosity Extraction
</text>
<slider bottom_delta="-30" can_edit_text="false" control_name="wmiBloomExtract"
decimal_digits="3" follows="left" height="10" increment="0.01"
<slider bottom_delta="-30" can_edit_text="true" control_name="BloomExtract"
decimal_digits="3" follows="left" height="18" increment="0.01"
initial_val="0.9" label="" left="14" max_val="1" min_val="0"
mouse_opaque="true" name="wmiBloomExtract" show_text="true" value="0.7"
mouse_opaque="true" name="BloomExtract" show_text="true" value="0.7"
width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-20" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="wmiBloomSizeText" v_pad="0" width="355">
left="10" mouse_opaque="true" name="BloomSizeText" v_pad="0" width="355">
Bloom Size
</text>
<slider bottom_delta="-30" can_edit_text="false" control_name="wmiBloomSize"
decimal_digits="3" follows="left" height="10" increment="0.01"
<slider bottom_delta="-30" can_edit_text="true" control_name="BloomSize"
decimal_digits="3" follows="left" height="18" increment="0.01"
initial_val="3.0" label="" left="14" max_val="20" min_val="0"
mouse_opaque="true" name="wmiBloomSize" show_text="true" value="1.0"
mouse_opaque="true" name="BloomSize" show_text="true" value="1.0"
width="200" />
<text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-20" drop_shadow_visible="true" follows="left|top|right"
font="SansSerif" h_pad="0" halign="left" height="16"
left="10" mouse_opaque="true" name="wmiBloomStrengthText" v_pad="0"
left="10" mouse_opaque="true" name="BloomStrengthText" v_pad="0"
width="355">
Bloom Strength
</text>
<slider bottom_delta="-30" can_edit_text="false" control_name="wmiBloomStrength"
decimal_digits="3" follows="left" height="10" increment="0.01"
<slider bottom_delta="-30" can_edit_text="true" control_name="BloomStrength"
decimal_digits="3" follows="left" height="18" increment="0.01"
initial_val="1.2" label="" left="14" max_val="10" min_val="0"
mouse_opaque="true" name="wmiBloomStrength" show_text="true" value="1.0"
mouse_opaque="true" name="BloomStrength" show_text="true" value="1.0"
width="200" />
</panel>
<panel border="true" bottom="-180" follows="left|top|right|bottom" height="400"

View File

@@ -668,6 +668,10 @@
mouse_opaque="true" name="Day Cycle Editor" width="169">
<on_click function="World.DayCycle" userdata="editor" />
</menu_item_call>
<menu_item_call bottom="-173" enabled="false" height="19" label="Post-Processing Effects" left="0"
mouse_opaque="true" name="Post-Processing Effects" width="169">
<on_click function="World.PostProcess" userdata="editor" />
</menu_item_call>
</menu>
</menu>
<menu bottom="-18" create_jump_keys="true" drop_shadow="true" enabled="true"

View File

@@ -1669,5 +1669,26 @@ Returns the value for header for request_id
llSetLinkTextureAnim(integer link, integer mode, integer face, integer sizex, integer sizey, float start, float length, float rate)
Animate the texture on the specified face/faces of the specified prim/prims by setting the texture scale and offset.
</string>
<string name="LSLTipText_llGetLinkNumberOfSides">
integer llGetLinkNumberOfSides(integer link)
Returns the number of sides of the specified linked prim.
</string>
<string name="LSLTipText_llGetUsername">
string llGetUsername(key id)
Returns the single-word username of an avatar, iff the avatar is in the current region, otherwise the empty string.
</string>
<string name="LSLTipText_llRequestUsername">
key llRequestUsername(key id)
Requests single-word username of an avatar. When data is available the dataserver event will be raised.
</string>
<string name="LSLTipText_llGetDisplayName">
string llGetDisplayName(key id)
Returns the name of an avatar, iff the avatar is in the current simulator, and the name has been cached, otherwise the same as llGetUsername. Use llRequestDisplayName if you absolutely must have the display name.
</string>
<string name="LSLTipText_llRequestDisplayName">
key llRequestDisplayName(key id)
Requests name of an avatar. When data is available the dataserver event will be raised.
</string>
</strings>

View File

@@ -936,9 +936,12 @@ anguage Infrstructure (CLI) international standard</string>
<key>windows</key>
<map>
<key>md5sum</key>
<string>fa5041874761895a06a20782b8ba34a2</string>
<string>b678c4d18ea8e4fab42b20f8d0b2629a</string>
<!--<string>fa5041874761895a06a20782b8ba34a2</string>-->
<key>url</key>
<uri>http://liny-odell.users.sourceforge.net/llqtwebkit-windows-qt4.6-20101122.tar.bz2</uri>
<uri>http://viewer-source-downloads.s3.amazonaws.com/install_pkgs/llqtwebkit-windows-qt4.7.1-20101221.tar.bz2</uri>
<!--<uri>http://liny-odell.users.sourceforge.net/llqtwebkit-windows-qt4.6-20101122.tar.bz2</uri>-->
</map>
</map>
</map>