No longer 'goth windlight only', sky parameters passed from settings object.
parent
0d414c1fb5
commit
52b0d4173c
|
|
@ -91,5 +91,25 @@ inline LLColor3 smear(F32 val)
|
|||
return LLColor3(val, val, val);
|
||||
}
|
||||
|
||||
inline F32 color_intens(const LLColor3 &col)
|
||||
{
|
||||
return col.mV[0] + col.mV[1] + col.mV[2];
|
||||
}
|
||||
|
||||
inline F32 color_max(const LLColor3 &col)
|
||||
{
|
||||
return llmax(col.mV[0], col.mV[1], col.mV[2]);
|
||||
}
|
||||
|
||||
inline F32 color_max(const LLColor4 &col)
|
||||
{
|
||||
return llmax(col.mV[0], col.mV[1], col.mV[2]);
|
||||
}
|
||||
|
||||
|
||||
inline F32 color_min(const LLColor3 &col)
|
||||
{
|
||||
return llmin(col.mV[0], col.mV[1], col.mV[2]);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@
|
|||
#include "llviewerparcelmgr.h"
|
||||
#include "llworldmapview.h"
|
||||
#include "llpostprocess.h"
|
||||
#include "llwlparammanager.h"
|
||||
#include "llwaterparammanager.h"
|
||||
|
||||
#include "lldebugview.h"
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@
|
|||
#include "pipeline.h"
|
||||
#include "llviewercamera.h"
|
||||
#include "llimage.h"
|
||||
#include "llwlparammanager.h"
|
||||
#include "llviewershadermgr.h"
|
||||
#include "llglslshader.h"
|
||||
#include "llsky.h"
|
||||
|
|
@ -83,7 +82,8 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
|
|||
}
|
||||
}
|
||||
|
||||
LLWLParamManager::getInstance()->propagateParameters();
|
||||
/* *LAPRAS */
|
||||
// LLWLParamManager::getInstance()->propagateParameters();
|
||||
}
|
||||
|
||||
LLDrawPoolWLSky::~LLDrawPoolWLSky()
|
||||
|
|
@ -312,7 +312,8 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
|
|||
}
|
||||
LL_RECORD_BLOCK_TIME(FTM_RENDER_WL_SKY);
|
||||
|
||||
const F32 camHeightLocal = LLWLParamManager::getInstance()->getDomeOffset() * LLWLParamManager::getInstance()->getDomeRadius();
|
||||
|
||||
const F32 camHeightLocal = LLEnvironment::instance().getCamHeight();
|
||||
|
||||
LLGLSNoFog disableFog;
|
||||
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
||||
|
|
@ -359,7 +360,7 @@ void LLDrawPoolWLSky::render(S32 pass)
|
|||
}
|
||||
LL_RECORD_BLOCK_TIME(FTM_RENDER_WL_SKY);
|
||||
|
||||
const F32 camHeightLocal = LLWLParamManager::getInstance()->getDomeOffset() * LLWLParamManager::getInstance()->getDomeRadius();
|
||||
const F32 camHeightLocal = LLEnvironment::instance().getCamHeight();
|
||||
|
||||
LLGLSNoFog disableFog;
|
||||
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@
|
|||
#include "llviewerregion.h"
|
||||
#include "llwaterparammanager.h"
|
||||
#include "llwlhandlers.h"
|
||||
#include "llwlparammanager.h"
|
||||
#include "lltrans.h"
|
||||
#include "lltrace.h"
|
||||
#include "llfasttimer.h"
|
||||
|
|
@ -65,6 +64,12 @@ LLEnvironment::~LLEnvironment()
|
|||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
F32 LLEnvironment::getCamHeight() const
|
||||
{
|
||||
return (mCurrentSky->getDomeOffset() * mCurrentSky->getDomeRadius());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
void LLEnvironment::update(const LLViewerCamera * cam)
|
||||
{
|
||||
|
|
@ -222,7 +227,7 @@ void LLEnvironment::updateShaderUniforms(LLGLSLShader *shader)
|
|||
stop_glerror();
|
||||
}
|
||||
|
||||
shader->uniform1f(LLShaderMgr::SCENE_LIGHT_STRENGTH, mCurrentSky->getSceneLightStrength());
|
||||
shader->uniform1f(LLShaderMgr::SCENE_LIGHT_STRENGTH, getSceneLightStrength());
|
||||
|
||||
// {
|
||||
// LLVector4 cloud_scroll(mCloudScroll[0], mCloudScroll[1], 0.0, 0.0);
|
||||
|
|
@ -244,6 +249,8 @@ void LLEnvironment::addSky(const LLSettingsSky::ptr_t &sky)
|
|||
{
|
||||
std::string name = sky->getValue(LLSettingsSky::SETTING_NAME).asString();
|
||||
|
||||
LL_WARNS("RIDER") << "Adding sky as '" << name << "'" << LL_ENDL;
|
||||
|
||||
std::pair<NamedSkyMap_t::iterator, bool> result;
|
||||
result = mSkysByName.insert(NamedSkyMap_t::value_type(name, sky));
|
||||
|
||||
|
|
@ -280,3 +287,14 @@ void LLEnvironment::clearAllSkys()
|
|||
mSkysById.clear();
|
||||
}
|
||||
|
||||
void LLEnvironment::selectSky(const std::string &name)
|
||||
{
|
||||
NamedSkyMap_t::iterator it = mSkysByName.find(name);
|
||||
|
||||
if (it == mSkysByName.end())
|
||||
return;
|
||||
|
||||
mCurrentSky = (*it).second;
|
||||
mCurrentSky->setDirtyFlag(true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,9 +54,16 @@ public:
|
|||
void updateShaderUniforms(LLGLSLShader *shader);
|
||||
|
||||
void addSky(const LLSettingsSky::ptr_t &sky);
|
||||
void selectSky(const std::string &name);
|
||||
|
||||
inline LLVector2 getCloudScrollDelta() const { return mCloudScrollDelta; }
|
||||
|
||||
F32 getCamHeight() const;
|
||||
|
||||
inline F32 getSceneLightStrength() const { return mSceneLightStrength; }
|
||||
inline void setSceneLightStrength(F32 light_strength) { mSceneLightStrength = light_strength; }
|
||||
|
||||
|
||||
private:
|
||||
static const F32 SUN_DELTA_YAW;
|
||||
|
||||
|
|
@ -71,6 +78,8 @@ private:
|
|||
NamedSkyMap_t mSkysByName;
|
||||
AssetSkyMap_t mSkysById;
|
||||
|
||||
F32 mSceneLightStrength;
|
||||
|
||||
void addSky(const LLUUID &id, const LLSettingsSky::ptr_t &sky);
|
||||
void removeSky(const std::string &name);
|
||||
void removeSky(const LLUUID &id);
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@
|
|||
#include "llwlparamset.h"
|
||||
#include "llwlparammanager.h"
|
||||
|
||||
#include "llenvironment.h"
|
||||
|
||||
LLFloaterEnvironmentSettings::LLFloaterEnvironmentSettings(const LLSD &key)
|
||||
: LLFloater(key)
|
||||
,mRegionSettingsRadioGroup(NULL)
|
||||
|
|
@ -188,7 +190,9 @@ void LLFloaterEnvironmentSettings::apply()
|
|||
{
|
||||
if (use_fixed_sky)
|
||||
{
|
||||
env_mgr.useSkyPreset(sky_preset);
|
||||
/* LAPRAS */
|
||||
//env_mgr.useSkyPreset(sky_preset);
|
||||
LLEnvironment::instance().selectSky(sky_preset);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -48,8 +48,11 @@ namespace
|
|||
LLTrace::BlockTimerStatHandle FTM_BLEND_ENVIRONMENT("Blending Environment Params");
|
||||
LLTrace::BlockTimerStatHandle FTM_UPDATE_ENVIRONMENT("Update Environment Params");
|
||||
|
||||
LLQuaternion body_position_from_angles(F32 azimuth, F32 altitude);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//=========================================================================
|
||||
const std::string LLSettingsSky::SETTING_AMBIENT("ambient");
|
||||
const std::string LLSettingsSky::SETTING_BLOOM_TEXTUREID("bloom_id");
|
||||
|
|
@ -112,38 +115,27 @@ LLSettingsSky::stringset_t LLSettingsSky::getSlerpKeys() const
|
|||
|
||||
LLSettingsSky::ptr_t LLSettingsSky::buildFromLegacyPreset(const std::string &name, const LLSD &oldsettings)
|
||||
{
|
||||
LLSD newsettings(LLSD::emptyMap());
|
||||
LLSD newsettings(defaults());
|
||||
|
||||
newsettings[SETTING_NAME] = name;
|
||||
|
||||
|
||||
if (oldsettings.has(SETTING_AMBIENT))
|
||||
{
|
||||
newsettings[SETTING_AMBIENT] = LLColor4(oldsettings[SETTING_AMBIENT]).getValue();
|
||||
}
|
||||
|
||||
if (oldsettings.has(SETTING_BLUE_DENSITY))
|
||||
{
|
||||
newsettings[SETTING_BLUE_DENSITY] = LLColor4(oldsettings[SETTING_BLUE_DENSITY]).getValue();
|
||||
}
|
||||
|
||||
if (oldsettings.has(SETTING_BLUE_HORIZON))
|
||||
{
|
||||
newsettings[SETTING_BLUE_HORIZON] = LLColor4(oldsettings[SETTING_BLUE_HORIZON]).getValue();
|
||||
}
|
||||
|
||||
if (oldsettings.has(SETTING_CLOUD_COLOR))
|
||||
{
|
||||
newsettings[SETTING_CLOUD_COLOR] = LLColor4(oldsettings[SETTING_CLOUD_COLOR]).getValue();
|
||||
}
|
||||
if (oldsettings.has(SETTING_SUNLIGHT_COLOR))
|
||||
{
|
||||
newsettings[SETTING_SUNLIGHT_COLOR] = LLColor4(oldsettings[SETTING_SUNLIGHT_COLOR]).getValue();
|
||||
}
|
||||
if (oldsettings.has(SETTING_CLOUD_SHADOW))
|
||||
{
|
||||
newsettings[SETTING_CLOUD_SHADOW] = LLSD::Real(oldsettings[SETTING_CLOUD_SHADOW][0].asReal());
|
||||
}
|
||||
|
||||
if (oldsettings.has(SETTING_CLOUD_POS_DENSITY1))
|
||||
{
|
||||
newsettings[SETTING_CLOUD_POS_DENSITY1] = LLColor4(oldsettings[SETTING_CLOUD_POS_DENSITY1]).getValue();
|
||||
|
|
@ -152,51 +144,10 @@ LLSettingsSky::ptr_t LLSettingsSky::buildFromLegacyPreset(const std::string &nam
|
|||
{
|
||||
newsettings[SETTING_CLOUD_POS_DENSITY2] = LLColor4(oldsettings[SETTING_CLOUD_POS_DENSITY2]).getValue();
|
||||
}
|
||||
if (oldsettings.has(SETTING_LIGHT_NORMAL))
|
||||
{
|
||||
newsettings[SETTING_LIGHT_NORMAL] = LLVector4(oldsettings[SETTING_LIGHT_NORMAL]).getValue();
|
||||
}
|
||||
|
||||
if (oldsettings.has(SETTING_CLOUD_SCALE))
|
||||
{
|
||||
newsettings[SETTING_CLOUD_SCALE] = LLSD::Real(oldsettings[SETTING_CLOUD_SCALE][0].asReal());
|
||||
}
|
||||
|
||||
if (oldsettings.has(SETTING_DENSITY_MULTIPLIER))
|
||||
{
|
||||
newsettings[SETTING_DENSITY_MULTIPLIER] = LLSD::Real(oldsettings[SETTING_DENSITY_MULTIPLIER][0].asReal());
|
||||
}
|
||||
if (oldsettings.has(SETTING_DISTANCE_MULTIPLIER))
|
||||
{
|
||||
newsettings[SETTING_DISTANCE_MULTIPLIER] = LLSD::Real(oldsettings[SETTING_DISTANCE_MULTIPLIER][0].asReal());
|
||||
}
|
||||
if (oldsettings.has(SETTING_HAZE_DENSITY))
|
||||
{
|
||||
newsettings[SETTING_HAZE_DENSITY] = LLSD::Real(oldsettings[SETTING_HAZE_DENSITY][0].asReal());
|
||||
}
|
||||
if (oldsettings.has(SETTING_HAZE_HORIZON))
|
||||
{
|
||||
newsettings[SETTING_HAZE_HORIZON] = LLSD::Real(oldsettings[SETTING_HAZE_HORIZON][0].asReal());
|
||||
}
|
||||
if (oldsettings.has(SETTING_MAX_Y))
|
||||
{
|
||||
newsettings[SETTING_MAX_Y] = LLSD::Real(oldsettings[SETTING_MAX_Y][0].asReal());
|
||||
}
|
||||
if (oldsettings.has(SETTING_STAR_BRIGHTNESS))
|
||||
{
|
||||
newsettings[SETTING_STAR_BRIGHTNESS] = LLSD::Real(oldsettings[SETTING_STAR_BRIGHTNESS].asReal());
|
||||
}
|
||||
|
||||
if (oldsettings.has(SETTING_GLOW))
|
||||
{
|
||||
newsettings[SETTING_GLOW] = LLColor4(oldsettings[SETTING_GLOW]).getValue();
|
||||
}
|
||||
|
||||
if (oldsettings.has(SETTING_GAMMA))
|
||||
{
|
||||
newsettings[SETTING_GAMMA] = LLVector4(oldsettings[SETTING_GAMMA]).getValue();
|
||||
}
|
||||
|
||||
if (oldsettings.has(SETTING_CLOUD_SCROLL_RATE))
|
||||
{
|
||||
LLVector2 cloud_scroll(oldsettings[SETTING_CLOUD_SCROLL_RATE]);
|
||||
|
|
@ -212,29 +163,69 @@ LLSettingsSky::ptr_t LLSettingsSky::buildFromLegacyPreset(const std::string &nam
|
|||
|
||||
newsettings[SETTING_CLOUD_SCROLL_RATE] = cloud_scroll.getValue();
|
||||
}
|
||||
if (oldsettings.has(SETTING_CLOUD_SHADOW))
|
||||
{
|
||||
newsettings[SETTING_CLOUD_SHADOW] = LLSD::Real(oldsettings[SETTING_CLOUD_SHADOW][0].asReal());
|
||||
}
|
||||
if (oldsettings.has(SETTING_DENSITY_MULTIPLIER))
|
||||
{
|
||||
newsettings[SETTING_DENSITY_MULTIPLIER] = LLSD::Real(oldsettings[SETTING_DENSITY_MULTIPLIER][0].asReal());
|
||||
}
|
||||
if (oldsettings.has(SETTING_DISTANCE_MULTIPLIER))
|
||||
{
|
||||
newsettings[SETTING_DISTANCE_MULTIPLIER] = LLSD::Real(oldsettings[SETTING_DISTANCE_MULTIPLIER][0].asReal());
|
||||
}
|
||||
if (oldsettings.has(SETTING_GAMMA))
|
||||
{
|
||||
newsettings[SETTING_GAMMA] = LLVector4(oldsettings[SETTING_GAMMA]).getValue();
|
||||
}
|
||||
if (oldsettings.has(SETTING_GLOW))
|
||||
{
|
||||
newsettings[SETTING_GLOW] = LLColor4(oldsettings[SETTING_GLOW]).getValue();
|
||||
}
|
||||
if (oldsettings.has(SETTING_HAZE_DENSITY))
|
||||
{
|
||||
newsettings[SETTING_HAZE_DENSITY] = LLSD::Real(oldsettings[SETTING_HAZE_DENSITY][0].asReal());
|
||||
}
|
||||
if (oldsettings.has(SETTING_HAZE_HORIZON))
|
||||
{
|
||||
newsettings[SETTING_HAZE_HORIZON] = LLSD::Real(oldsettings[SETTING_HAZE_HORIZON][0].asReal());
|
||||
}
|
||||
if (oldsettings.has(SETTING_LIGHT_NORMAL))
|
||||
{
|
||||
newsettings[SETTING_LIGHT_NORMAL] = LLVector4(oldsettings[SETTING_LIGHT_NORMAL]).getValue();
|
||||
}
|
||||
if (oldsettings.has(SETTING_MAX_Y))
|
||||
{
|
||||
newsettings[SETTING_MAX_Y] = LLSD::Real(oldsettings[SETTING_MAX_Y][0].asReal());
|
||||
}
|
||||
if (oldsettings.has(SETTING_STAR_BRIGHTNESS))
|
||||
{
|
||||
newsettings[SETTING_STAR_BRIGHTNESS] = LLSD::Real(oldsettings[SETTING_STAR_BRIGHTNESS].asReal());
|
||||
}
|
||||
if (oldsettings.has(SETTING_SUNLIGHT_COLOR))
|
||||
{
|
||||
newsettings[SETTING_SUNLIGHT_COLOR] = LLColor4(oldsettings[SETTING_SUNLIGHT_COLOR]).getValue();
|
||||
}
|
||||
|
||||
|
||||
// dfltsetting[SETTING_DOME_OFFSET] = LLSD::Real(0.96f);
|
||||
// dfltsetting[SETTING_DOME_RADIUS] = LLSD::Real(15000.f);
|
||||
//
|
||||
// dfltsetting[SETTING_MOON_ROTATION] = moonquat.getValue();
|
||||
// dfltsetting[SETTING_SUN_ROTATION] = sunquat.getValue();
|
||||
//
|
||||
// dfltsetting[SETTING_BLOOM_TEXTUREID] = LLUUID::null;
|
||||
// dfltsetting[SETTING_CLOUD_TEXTUREID] = LLUUID::null;
|
||||
// dfltsetting[SETTING_MOON_TEXTUREID] = IMG_SUN; // gMoonTextureID; // These two are returned by the login... wow!
|
||||
// dfltsetting[SETTING_SUN_TEXUTUREID] = IMG_MOON; // gSunTextureID;
|
||||
|
||||
if (oldsettings.has(SETTING_LEGACY_EAST_ANGLE) && oldsettings.has(SETTING_LEGACY_SUN_ANGLE))
|
||||
{ // convert the east and sun angles into a quaternion.
|
||||
F32 east = oldsettings[SETTING_LEGACY_EAST_ANGLE].asReal();
|
||||
F32 azimuth = oldsettings[SETTING_LEGACY_SUN_ANGLE].asReal();
|
||||
F32 azimuth = oldsettings[SETTING_LEGACY_EAST_ANGLE].asReal();
|
||||
F32 altitude = oldsettings[SETTING_LEGACY_SUN_ANGLE].asReal();
|
||||
|
||||
LLQuaternion sunquat;
|
||||
sunquat.setEulerAngles(azimuth, 0.0, east);
|
||||
// // set the sun direction from SunAngle and EastAngle
|
||||
// F32 sinTheta = sin(east);
|
||||
// F32 cosTheta = cos(east);
|
||||
//
|
||||
// F32 sinPhi = sin(azimuth);
|
||||
// F32 cosPhi = cos(azimuth);
|
||||
//
|
||||
// LLVector4 sunDir;
|
||||
// sunDir.mV[0] = -sinTheta * cosPhi;
|
||||
// sunDir.mV[1] = sinPhi;
|
||||
// sunDir.mV[2] = cosTheta * cosPhi;
|
||||
// sunDir.mV[3] = 0;
|
||||
//
|
||||
// LLQuaternion sunquat = LLQuaternion(0.1, sunDir); // small rotation around axis
|
||||
LLQuaternion sunquat = ::body_position_from_angles(azimuth, altitude);
|
||||
LLQuaternion moonquat = ~sunquat;
|
||||
|
||||
newsettings[SETTING_SUN_ROTATION] = sunquat.getValue();
|
||||
|
|
@ -252,7 +243,7 @@ LLSettingsSky::ptr_t LLSettingsSky::buildDefaultSky()
|
|||
LLSD settings = LLSettingsSky::defaults();
|
||||
|
||||
LLSettingsSky::ptr_t skyp = boost::make_shared<LLSettingsSky>(settings);
|
||||
skyp->update();
|
||||
//skyp->update();
|
||||
|
||||
return skyp;
|
||||
}
|
||||
|
|
@ -458,7 +449,7 @@ void LLSettingsSky::calculateLightSettings()
|
|||
// between sunlight and point lights in windlight to normalize point lights.
|
||||
F32 sun_dynamic_range = std::max(gSavedSettings.getF32("RenderSunDynamicRange"), 0.0001f);
|
||||
|
||||
mSceneLightStrength = 2.0f * (1.0f + sun_dynamic_range * dp);
|
||||
LLEnvironment::instance().setSceneLightStrength(2.0f * (1.0f + sun_dynamic_range * dp));
|
||||
|
||||
mSunDiffuse = vary_SunlightColor;
|
||||
mSunAmbient = vary_AmbientColor;
|
||||
|
|
@ -506,8 +497,6 @@ void LLSettingsSky::applySpecial(void *ptarget)
|
|||
|
||||
shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, mLightDirectionClamped.mV);
|
||||
|
||||
shader->uniform1f(LLShaderMgr::SCENE_LIGHT_STRENGTH, mSceneLightStrength);
|
||||
|
||||
shader->uniform4f(LLShaderMgr::GAMMA, getGama(), 0.0, 0.0, 1.0);
|
||||
|
||||
{
|
||||
|
|
@ -534,3 +523,30 @@ void LLSettingsSky::applySpecial(void *ptarget)
|
|||
//param_map[SETTING_CLOUD_POS_DENSITY1] = LLShaderMgr::CLOUD_POS_DENSITY1;
|
||||
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
namespace
|
||||
{
|
||||
LLQuaternion body_position_from_angles(F32 azimuth, F32 altitude)
|
||||
{
|
||||
static const LLVector3 VECT_ZENITH(0.f, 0.f, 1.f);
|
||||
static const LLVector3 VECT_NORTHSOUTH(0.f, 1.f, 0.f);
|
||||
|
||||
// Azimuth is traditionally calculated from North, we are going from East.
|
||||
LLQuaternion rot_azi;
|
||||
LLQuaternion rot_alt;
|
||||
|
||||
rot_azi.setAngleAxis(azimuth, VECT_ZENITH);
|
||||
rot_alt.setAngleAxis(-altitude, VECT_NORTHSOUTH);
|
||||
|
||||
LLQuaternion body_quat = rot_alt * rot_azi;
|
||||
body_quat.normalize();
|
||||
|
||||
LLVector3 sun_vector = (DUE_EAST * body_quat);
|
||||
|
||||
|
||||
LL_WARNS("RIDER") << "Azimuth=" << azimuth << " Altitude=" << altitude << " Body Vector=" << sun_vector.getValue() << LL_ENDL;
|
||||
|
||||
return body_quat;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -233,12 +233,6 @@ public:
|
|||
return mLightDirectionClamped;
|
||||
};
|
||||
|
||||
F32 getSceneLightStrength() const
|
||||
{
|
||||
update();
|
||||
return mSceneLightStrength;
|
||||
}
|
||||
|
||||
LLVector3 getSunDirection() const
|
||||
{
|
||||
update();
|
||||
|
|
@ -304,7 +298,6 @@ private:
|
|||
|
||||
LLVector3 mSunDirection;
|
||||
LLVector3 mMoonDirection;
|
||||
F32 mSceneLightStrength;
|
||||
LLVector3 mLightDirection;
|
||||
LLVector3 mLightDirectionClamped;
|
||||
|
||||
|
|
|
|||
|
|
@ -202,8 +202,6 @@ void display_update_camera()
|
|||
gViewerWindow->setup3DRender();
|
||||
|
||||
// update all the sky/atmospheric/water settings
|
||||
// *LAPRAS
|
||||
//LLWLParamManager::getInstance()->update(LLViewerCamera::getInstance());
|
||||
LLEnvironment::instance().update(LLViewerCamera::getInstance());
|
||||
LLWaterParamManager::getInstance()->update(LLViewerCamera::getInstance());
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
#include "llviewercontrol.h"
|
||||
#include "pipeline.h"
|
||||
#include "llworld.h"
|
||||
#include "llwlparammanager.h"
|
||||
#include "llwaterparammanager.h"
|
||||
#include "llsky.h"
|
||||
#include "llvosky.h"
|
||||
|
|
@ -3430,9 +3429,7 @@ std::string LLViewerShaderMgr::getShaderDirPrefix(void)
|
|||
|
||||
void LLViewerShaderMgr::updateShaderUniforms(LLGLSLShader * shader)
|
||||
{
|
||||
//*LAPRAS*/
|
||||
LLEnvironment::instance().updateShaderUniforms(shader);
|
||||
//LLWLParamManager::getInstance()->updateShaderUniforms(shader);
|
||||
LLWaterParamManager::getInstance()->updateShaderUniforms(shader);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -962,7 +962,7 @@ void LLVOSky::calcAtmospherics(void)
|
|||
// Since WL scales everything by 2, there should always be at least a 2:1 brightness ratio
|
||||
// between sunlight and point lights in windlight to normalize point lights.
|
||||
F32 sun_dynamic_range = llmax(gSavedSettings.getF32("RenderSunDynamicRange"), 0.0001f);
|
||||
LLWLParamManager::getInstance()->mSceneLightStrength = 2.0f * (1.0f + sun_dynamic_range * dp);
|
||||
LLEnvironment::instance().setSceneLightStrength(2.0f * (1.0f + sun_dynamic_range * dp));
|
||||
|
||||
mSunDiffuse = vary_SunlightColor;
|
||||
mSunAmbient = vary_AmbientColor;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "llviewertexture.h"
|
||||
#include "llviewerobject.h"
|
||||
#include "llframetimer.h"
|
||||
#include "v3colorutil.h"
|
||||
|
||||
|
||||
//////////////////////////////////
|
||||
|
|
@ -85,26 +86,6 @@ BOOL clip_quad_to_horizon(F32& t_left, F32& t_right, LLVector3 v_clipped[4],
|
|||
const LLVector3 v_corner[4], const F32 cos_max_angle);
|
||||
F32 clip_side_to_horizon(const LLVector3& v0, const LLVector3& v1, const F32 cos_max_angle);
|
||||
|
||||
inline F32 color_intens ( const LLColor3 &col )
|
||||
{
|
||||
return col.mV[0] + col.mV[1] + col.mV[2];
|
||||
}
|
||||
|
||||
inline F32 color_max(const LLColor3 &col)
|
||||
{
|
||||
return llmax(col.mV[0], col.mV[1], col.mV[2]);
|
||||
}
|
||||
|
||||
inline F32 color_max(const LLColor4 &col)
|
||||
{
|
||||
return llmax(col.mV[0], col.mV[1], col.mV[2]);
|
||||
}
|
||||
|
||||
|
||||
inline F32 color_min(const LLColor3 &col)
|
||||
{
|
||||
return llmin(col.mV[0], col.mV[1], col.mV[2]);
|
||||
}
|
||||
|
||||
class LLFace;
|
||||
class LLHaze;
|
||||
|
|
|
|||
|
|
@ -32,8 +32,9 @@
|
|||
#include "llsky.h"
|
||||
#include "lldrawpoolwlsky.h"
|
||||
#include "llface.h"
|
||||
#include "llwlparammanager.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llenvironment.h"
|
||||
#include "llsettingssky.h"
|
||||
|
||||
#define DOME_SLICES 1
|
||||
const F32 LLVOWLSky::DISTANCE_TO_STARS = (HORIZON_DIST - 10.f)*0.25f;
|
||||
|
|
@ -232,7 +233,7 @@ void subdivide(LLVertexBuffer& in, LLVertexBuffer* ret)
|
|||
void chop(LLVertexBuffer& in, LLVertexBuffer* out)
|
||||
{
|
||||
//chop off all triangles below horizon
|
||||
F32 d = LLWLParamManager::sParamMgr->getDomeOffset() * LLWLParamManager::sParamMgr->getDomeRadius();
|
||||
F32 d = LLEnvironment::instance().getCamHeight();
|
||||
|
||||
std::vector<LLVector3> vert;
|
||||
|
||||
|
|
@ -399,7 +400,7 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable)
|
|||
#else
|
||||
mStripsVerts = new LLVertexBuffer(LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK, GL_STATIC_DRAW_ARB);
|
||||
|
||||
const F32 RADIUS = LLWLParamManager::sParamMgr->getDomeRadius();
|
||||
const F32 RADIUS = LLEnvironment::getCurrentSky()->getDomeRadius();
|
||||
|
||||
LLPointer<LLVertexBuffer> temp = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX, 0);
|
||||
temp->allocateBuffer(12, 60, TRUE);
|
||||
|
|
@ -574,7 +575,7 @@ void LLVOWLSky::buildFanBuffer(LLStrider<LLVector3> & vertices,
|
|||
LLStrider<LLVector2> & texCoords,
|
||||
LLStrider<U16> & indices)
|
||||
{
|
||||
const F32 RADIUS = LLWLParamManager::getInstance()->getDomeRadius();
|
||||
const F32 RADIUS = LLEnvironment::instance().getCurrentSky()->getDomeRadius();
|
||||
|
||||
U32 i, num_slices;
|
||||
F32 phi0, theta, x0, y0, z0;
|
||||
|
|
@ -635,7 +636,7 @@ void LLVOWLSky::buildStripsBuffer(U32 begin_stack, U32 end_stack,
|
|||
LLStrider<LLVector2> & texCoords,
|
||||
LLStrider<U16> & indices)
|
||||
{
|
||||
const F32 RADIUS = LLWLParamManager::getInstance()->getDomeRadius();
|
||||
const F32 RADIUS = LLEnvironment::instance().getCurrentSky()->getDomeRadius();
|
||||
|
||||
U32 i, j, num_slices, num_stacks;
|
||||
F32 phi0, theta, x0, y0, z0;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
#include "llagentcamera.h"
|
||||
#include "llviewerregion.h"
|
||||
|
||||
#include "llwlparammanager.h"
|
||||
#include "llenvironment.h"
|
||||
#include "llwaterparamset.h"
|
||||
|
||||
#include "curl/curl.h"
|
||||
|
|
@ -187,8 +187,8 @@ void LLWaterParamManager::updateShaderUniforms(LLGLSLShader * shader)
|
|||
{
|
||||
if (shader->mShaderGroup == LLGLSLShader::SG_WATER)
|
||||
{
|
||||
shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, LLWLParamManager::getInstance()->getRotatedLightDir().mV);
|
||||
shader->uniform3fv(LLShaderMgr::WL_CAMPOSLOCAL, 1, LLViewerCamera::getInstance()->getOrigin().mV);
|
||||
shader->uniform4fv(LLViewerShaderMgr::LIGHTNORM, 1, LLEnvironment::instance().getRotatedLightDir().mV);
|
||||
shader->uniform3fv(LLShaderMgr::WL_CAMPOSLOCAL, 1, LLViewerCamera::getInstance()->getOrigin().mV);
|
||||
shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, LLDrawPoolWater::sWaterFogColor.mV);
|
||||
shader->uniform4fv(LLShaderMgr::WATER_WATERPLANE, 1, mWaterPlane.mV);
|
||||
shader->uniform1f(LLShaderMgr::WATER_FOGDENSITY, getFogDensity());
|
||||
|
|
@ -207,7 +207,9 @@ void LLWaterParamManager::applyParams(const LLSD& params, bool interpolate)
|
|||
|
||||
if (interpolate)
|
||||
{
|
||||
LLWLParamManager::getInstance()->mAnimator.startInterpolation(params);
|
||||
// *LAPRAS
|
||||
|
||||
//LLWLParamManager::getInstance()->mAnimator.startInterpolation(params);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -100,7 +100,6 @@
|
|||
#include "llviewerstats.h"
|
||||
#include "llviewerjoystick.h"
|
||||
#include "llviewerdisplay.h"
|
||||
#include "llwlparammanager.h"
|
||||
#include "llwaterparammanager.h"
|
||||
#include "llspatialpartition.h"
|
||||
#include "llmutelist.h"
|
||||
|
|
|
|||
Loading…
Reference in New Issue