Get libatmosphere shader into link chain for Adv WL shaders.

Point autobuild at fixed libatmosphere.
master
Graham Linden graham@lindenlab.com 2018-03-08 22:26:31 +00:00
parent 54ee5bfc05
commit 84e47f45f6
4 changed files with 79 additions and 74 deletions

View File

@ -64,9 +64,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>e126000b6d480847b8bb86223001e5af</string>
<string>7111aa4198ff296b56e63f62facc14f2</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/14535/92948/libatmosphere-1.0.0.100-darwin-513092.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/14660/93991/libatmosphere-1.0.0.100-darwin-513164.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@ -76,9 +76,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>b326d4a32c089a0063f1c4300e85b013</string>
<string>7e81995a02ba99d406bcedf33cda3e95</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/14536/92954/libatmosphere-1.0.0.100-darwin64-513092.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/14659/93990/libatmosphere-1.0.0.100-darwin64-513164.tar.bz2</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -88,9 +88,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>4722cd9c689bf22822809cee66b68a60</string>
<string>226ab55f8020fc3749b75418cc3cc2ce</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/14538/92964/libatmosphere-1.0.0.100-windows-513092.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/14657/93975/libatmosphere-1.0.0.100-windows64-513164.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>

View File

@ -33,6 +33,7 @@ in vec3 view_dir;
uniform vec3 cameraPosLocal;
uniform vec3 sun_direction;
uniform float sun_size;
uniform sampler2D transmittance_texture;
uniform sampler3D scattering_texture;
@ -54,7 +55,7 @@ void main()
radiance *= transmittance;
// If the view ray intersects the Sun, add the Sun radiance.
if (dot(view_direction, sun_direction) >= sun_size.y)
if (dot(view_direction, sun_direction) >= sun_size)
{
radiance = radiance + transmittance * GetSolarLuminance();
}

View File

@ -3331,7 +3331,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight()
success = gInscatterRectProgram.createShader(NULL, NULL);
}
if (success && (mVertexShaderLevel[SHADER_WINDLIGHT] < 3))
if (success)
{
gWLSkyProgram.mName = "Windlight Sky Shader";
//gWLSkyProgram.mFeatures.hasGamma = true;
@ -3340,10 +3340,12 @@ BOOL LLViewerShaderMgr::loadShadersWindLight()
gWLSkyProgram.mShaderFiles.push_back(make_pair("windlight/skyF.glsl", GL_FRAGMENT_SHADER_ARB));
gWLSkyProgram.mShaderLevel = mVertexShaderLevel[SHADER_WINDLIGHT];
gWLSkyProgram.mShaderGroup = LLGLSLShader::SG_SKY;
if (gAtmosphere != nullptr)
gWLSkyProgram.mExtraLinkObject = gAtmosphere->getAtmosphericShaderForLink();
success = gWLSkyProgram.createShader(NULL, NULL);
}
if (success && (mVertexShaderLevel[SHADER_WINDLIGHT] < 3))
if (success)
{
gWLCloudProgram.mName = "Windlight Cloud Program";
//gWLCloudProgram.mFeatures.hasGamma = true;
@ -3352,6 +3354,8 @@ BOOL LLViewerShaderMgr::loadShadersWindLight()
gWLCloudProgram.mShaderFiles.push_back(make_pair("windlight/cloudsF.glsl", GL_FRAGMENT_SHADER_ARB));
gWLCloudProgram.mShaderLevel = mVertexShaderLevel[SHADER_WINDLIGHT];
gWLCloudProgram.mShaderGroup = LLGLSLShader::SG_SKY;
if (gAtmosphere != nullptr)
gWLCloudProgram.mExtraLinkObject = gAtmosphere->getAtmosphericShaderForLink();
success = gWLCloudProgram.createShader(NULL, NULL);
}

View File

@ -555,85 +555,85 @@ BOOL LLVOSky::updateSky()
if (mForceUpdate || total_no_tiles == frame)
{
LLSkyTex::stepCurrent();
LLSkyTex::stepCurrent();
const static F32 LIGHT_DIRECTION_THRESHOLD = (F32) cos(DEG_TO_RAD * 1.f);
const static F32 COLOR_CHANGE_THRESHOLD = 0.01f;
const static F32 LIGHT_DIRECTION_THRESHOLD = (F32) cos(DEG_TO_RAD * 1.f);
const static F32 COLOR_CHANGE_THRESHOLD = 0.01f;
LLVector3 direction = mSun.getDirection();
direction.normalize();
const F32 dot_lighting = direction * mLastLightingDirection;
LLVector3 direction = mSun.getDirection();
direction.normalize();
const F32 dot_lighting = direction * mLastLightingDirection;
LLColor3 delta_color;
delta_color.setVec(mLastTotalAmbient.mV[0] - total_ambient.mV[0],
mLastTotalAmbient.mV[1] - total_ambient.mV[1],
mLastTotalAmbient.mV[2] - total_ambient.mV[2]);
LLColor3 delta_color;
delta_color.setVec(mLastTotalAmbient.mV[0] - total_ambient.mV[0],
mLastTotalAmbient.mV[1] - total_ambient.mV[1],
mLastTotalAmbient.mV[2] - total_ambient.mV[2]);
if ( mForceUpdate
|| (((dot_lighting < LIGHT_DIRECTION_THRESHOLD)
|| (delta_color.length() > COLOR_CHANGE_THRESHOLD)
|| !mInitialized)
&& !direction.isExactlyZero()))
{
mLastLightingDirection = direction;
mLastTotalAmbient = total_ambient;
mInitialized = TRUE;
if ( mForceUpdate
|| (((dot_lighting < LIGHT_DIRECTION_THRESHOLD)
|| (delta_color.length() > COLOR_CHANGE_THRESHOLD)
|| !mInitialized)
&& !direction.isExactlyZero()))
{
mLastLightingDirection = direction;
mLastTotalAmbient = total_ambient;
mInitialized = TRUE;
if (mCubeMap)
{
if (mForceUpdate)
{
updateFog(LLViewerCamera::getInstance()->getFar());
for (int side = 0; side < 6; side++)
{
for (int tile = 0; tile < NUM_TILES; tile++)
{
createSkyTexture(side, tile);
}
}
for (int side = 0; side < 6; side++)
{
LLImageRaw* raw1 = mSkyTex[side].getImageRaw(TRUE);
LLImageRaw* raw2 = mSkyTex[side].getImageRaw(FALSE);
raw2->copy(raw1);
mSkyTex[side].createGLImage(mSkyTex[side].getWhich(FALSE));
raw1 = mShinyTex[side].getImageRaw(TRUE);
raw2 = mShinyTex[side].getImageRaw(FALSE);
raw2->copy(raw1);
mShinyTex[side].createGLImage(mShinyTex[side].getWhich(FALSE));
}
next_frame = 0;
// update the sky texture
for (S32 i = 0; i < 6; ++i)
if (mCubeMap)
{
mSkyTex[i].create(1.0f);
mShinyTex[i].create(1.0f);
}
if (mForceUpdate)
{
updateFog(LLViewerCamera::getInstance()->getFar());
// update the environment map
for (int side = 0; side < 6; side++)
{
for (int tile = 0; tile < NUM_TILES; tile++)
{
createSkyTexture(side, tile);
}
}
for (int side = 0; side < 6; side++)
{
LLImageRaw* raw1 = mSkyTex[side].getImageRaw(TRUE);
LLImageRaw* raw2 = mSkyTex[side].getImageRaw(FALSE);
raw2->copy(raw1);
mSkyTex[side].createGLImage(mSkyTex[side].getWhich(FALSE));
raw1 = mShinyTex[side].getImageRaw(TRUE);
raw2 = mShinyTex[side].getImageRaw(FALSE);
raw2->copy(raw1);
mShinyTex[side].createGLImage(mShinyTex[side].getWhich(FALSE));
}
next_frame = 0;
// update the sky texture
for (S32 i = 0; i < 6; ++i)
{
mSkyTex[i].create(1.0f);
mShinyTex[i].create(1.0f);
}
// update the environment map
if (mCubeMap)
{
std::vector<LLPointer<LLImageRaw> > images;
images.reserve(6);
for (S32 side = 0; side < 6; side++)
{
images.push_back(mShinyTex[side].getImageRaw(TRUE));
}
mCubeMap->init(images);
std::vector<LLPointer<LLImageRaw> > images;
images.reserve(6);
for (S32 side = 0; side < 6; side++)
{
images.push_back(mShinyTex[side].getImageRaw(TRUE));
}
mCubeMap->init(images);
gGL.getTexUnit(0)->disable();
}
}
}
}
}
gPipeline.markRebuild(gSky.mVOGroundp->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
mForceUpdate = FALSE;
}
}
gPipeline.markRebuild(gSky.mVOGroundp->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
mForceUpdate = FALSE;
}
}
if (mDrawable.notNull() && mDrawable->getFace(0) && !mDrawable->getFace(0)->getVertexBuffer())
{