diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llprimitive/lltextureentry.cpp | 3 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl | 5 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl | 4 | ||||
-rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llpanelface.cpp | 98 | ||||
-rw-r--r-- | indra/newview/llpanelface.h | 13 |
6 files changed, 78 insertions, 51 deletions
diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp index 691216e035..53816266eb 100644 --- a/indra/llprimitive/lltextureentry.cpp +++ b/indra/llprimitive/lltextureentry.cpp @@ -85,7 +85,7 @@ LLTextureEntry::LLTextureEntry(const LLTextureEntry &rhs) mMediaFlags = rhs.mMediaFlags; mGlow = rhs.mGlow; mMaterialID = rhs.mMaterialID; - + mMaterial = rhs.mMaterial; if (rhs.mMediaEntry != NULL) { // Make a copy mMediaEntry = new LLMediaEntry(*rhs.mMediaEntry); @@ -107,6 +107,7 @@ LLTextureEntry &LLTextureEntry::operator=(const LLTextureEntry &rhs) mMediaFlags = rhs.mMediaFlags; mGlow = rhs.mGlow; mMaterialID = rhs.mMaterialID; + mMaterial = rhs.mMaterial; if (mMediaEntry != NULL) { delete mMediaEntry; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl index b91aaf80fb..8d76485886 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl @@ -42,8 +42,9 @@ void main() { float shadow = 1.0; - vec4 color = diffuseLookup(vary_texcoord0.xy)*vertex_color; - color.rgb = pow(color.rgb, vec3(2.2)); + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; + color.rgb = pow(color.rgb,vec3(2.2f,2.2f,2.2f)); + color.rgb = fullbrightAtmosTransport(color.rgb); color.rgb = fullbrightScaleSoftClip(color.rgb); diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl index 2e6982d101..3f09a15375 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl @@ -57,8 +57,6 @@ void main() vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; calcAtmospherics(pos.xyz); - - vertex_color = diffuse_color; - + vertex_color = diffuse_color; } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index b45c944a5f..55b03986d0 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1149,7 +1149,7 @@ void LLFloaterPreference::refreshEnabledState() //Deferred/SSAO/Shadows LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders"); - BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && + BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && ((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) && shaders && gGLManager.mHasFramebufferObject && @@ -1163,7 +1163,9 @@ void LLFloaterPreference::refreshEnabledState() LLComboBox* ctrl_shadow = getChild<LLComboBox>("ShadowDetail"); enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); - + + ctrl_deferred->set(gSavedSettings.getBOOL("RenderDeferred")); + ctrl_ssao->setEnabled(enabled); ctrl_dof->setEnabled(enabled); diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index f55d53fa29..9c40ff06cc 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -158,9 +158,9 @@ BOOL LLPanelFace::postBuild() if(mShinyTextureCtrl) { mShinyTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectTexture" ))); - mShinyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitMaterialTexture, this, _2) ); - mShinyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelMaterialTexture, this, _2) ); - mShinyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectMaterialTexture, this, _2) ); + mShinyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitSpecularTexture, this, _2) ); + mShinyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelSpecularTexture, this, _2) ); + mShinyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectSpecularTexture, this, _2) ); mShinyTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2)); mShinyTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1)); mShinyTextureCtrl->setFollowsTop(); @@ -173,9 +173,9 @@ BOOL LLPanelFace::postBuild() if(mBumpyTextureCtrl) { mBumpyTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectTexture" ))); - mBumpyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitMaterialTexture, this, _2) ); - mBumpyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelMaterialTexture, this, _2) ); - mBumpyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectMaterialTexture, this, _2) ); + mBumpyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitNormalTexture, this, _2) ); + mBumpyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelNormalTexture, this, _2) ); + mBumpyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectNormalTexture, this, _2) ); mBumpyTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2)); mBumpyTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1)); mBumpyTextureCtrl->setFollowsTop(); @@ -303,14 +303,14 @@ void LLPanelFace::sendBump() LLTextureCtrl* bumpytexture_ctrl = getChild<LLTextureCtrl>("bumpytexture control"); bumpytexture_ctrl->clear(); LLSD dummy_data; - onSelectMaterialTexture(dummy_data); + onSelectNormalTexture(dummy_data); } U8 bump = (U8) bumpiness & TEM_BUMP_MASK; LLSelectMgr::getInstance()->selectionSetBumpmap( bump ); //refresh material state (in case this change impacts material params) LLSD dummy_data; - onCommitMaterialTexture(dummy_data); + onCommitNormalTexture(dummy_data); } void LLPanelFace::sendTexGen() @@ -333,6 +333,10 @@ void LLPanelFace::sendShiny() } U8 shiny = (U8) shininess & TEM_SHINY_MASK; LLSelectMgr::getInstance()->selectionSetShiny( shiny ); + + //refresh material state (in case this change impacts material params) + LLSD dummy_data; + onCommitSpecularTexture(dummy_data); } void LLPanelFace::sendFullbright() @@ -1537,7 +1541,7 @@ void LLPanelFace::getState() { enabled = (editable && ((shiny == SHINY_TEXTURE) && !specmap_id.isNull())); identical = identical_spec_repeats; - repeats = repeats_spec * (identical_planar_texgen ? 2.0f : 1.0f); + repeats = repeats_spec; } break; @@ -1545,12 +1549,12 @@ void LLPanelFace::getState() { enabled = (editable && ((bumpy == BUMPY_TEXTURE) && !normmap_id.isNull())); identical = identical_norm_repeats; - repeats = repeats_norm * (identical_planar_texgen ? 2.0f : 1.0f); + repeats = repeats_norm; } break; } - getChildView("rptctrl")->setEnabled(enabled); + getChildView("rptctrl")->setEnabled(identical_planar_texgen ? FALSE : enabled); getChild<LLUICtrl>("rptctrl")->setValue(editable ? repeats : 1.0f); getChild<LLUICtrl>("rptctrl")->setTentative(!identical); } @@ -1716,7 +1720,7 @@ void LLPanelFace::onMaterialLoaded(const LLMaterialID& material_id, const LLMate getChild<LLUICtrl>("glossiness")->setValue(material->getSpecularLightExponent()); getChild<LLUICtrl>("environment")->setValue(material->getEnvironmentIntensity()); } - updateShinyControls(combobox_shininess,this, true); + updateShinyControls(combobox_shininess,this, !material->getSpecularID().isNull(), true); // Assert desired colorswatch color to match material AFTER updateShinyControls // to avoid getting overwritten with the default on some UI state changes. @@ -1749,7 +1753,7 @@ void LLPanelFace::onMaterialLoaded(const LLMaterialID& material_id, const LLMate getChild<LLUICtrl>("bumpyOffsetU")->setValue(offset_x); getChild<LLUICtrl>("bumpyOffsetV")->setValue(offset_y); } - updateBumpyControls(combobox_bumpiness,this, true); + updateBumpyControls(combobox_bumpiness,this, !material->getNormalID().isNull(), true); } void LLPanelFace::updateMaterial() @@ -1820,7 +1824,7 @@ void LLPanelFace::updateMaterial() material_to_set->setAlphaMaskCutoff((U8)(getChild<LLUICtrl>("maskcutoff")->getValue().asInteger())); LLUUID norm_map_id = getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID(); - if (!norm_map_id.isNull()) + if (!norm_map_id.isNull() && (bumpiness == BUMPY_TEXTURE)) { LL_DEBUGS("Materials") << "Setting bumpy texture, bumpiness = " << bumpiness << LL_ENDL; material_to_set->setNormalID(norm_map_id); @@ -1850,7 +1854,7 @@ void LLPanelFace::updateMaterial() LLUUID spec_map_id = getChild<LLTextureCtrl>("shinytexture control")->getImageAssetID(); - if (!spec_map_id.isNull()) + if (!spec_map_id.isNull() && (shininess == SHINY_TEXTURE)) { LL_DEBUGS("Materials") << "Setting shiny texture, shininess = " << shininess << LL_ENDL; material_to_set->setSpecularID(spec_map_id); @@ -1978,7 +1982,7 @@ void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata) bool show_bumpiness = (!show_media) && (material_type == MATTYPE_NORMAL) && combo_matmedia->getEnabled(); bool show_shininess = (!show_media) && (material_type == MATTYPE_SPECULAR) && combo_matmedia->getEnabled(); self->getChildView("combobox mattype")->setVisible(!show_media); - self->getChildView("rptctrl")->setVisible(show_texture); + self->getChildView("rptctrl")->setVisible(true); // Media controls self->getChildView("media_info")->setVisible(show_media); @@ -2084,10 +2088,8 @@ void LLPanelFace::onCommitBump(LLUICtrl* ctrl, void* userdata) self->sendBump(); LLComboBox* combo_bumpy = self->getChild<LLComboBox>("combobox bumpiness"); - // Need 'true' here to insure that the 'Use Texture' choice is removed - // when we select something other than a normmap texture - // - updateBumpyControls(combo_bumpy,self, true); + + updateBumpyControls(combo_bumpy,self, false, true); self->updateMaterial(); } @@ -2099,7 +2101,7 @@ void LLPanelFace::onCommitTexGen(LLUICtrl* ctrl, void* userdata) } // static -void LLPanelFace::updateShinyControls(LLUICtrl* ctrl, void* userdata, bool mess_with_shiny_combobox) +void LLPanelFace::updateShinyControls(LLUICtrl* ctrl, void* userdata, bool is_setting_texture, bool mess_with_shiny_combobox) { LLPanelFace* self = (LLPanelFace*) userdata; LLTextureCtrl* texture_ctrl = self->getChild<LLTextureCtrl>("shinytexture control"); @@ -2113,7 +2115,7 @@ void LLPanelFace::updateShinyControls(LLUICtrl* ctrl, void* userdata, bool mess_ { return; } - if (!shiny_texture_ID.isNull()) + if (!shiny_texture_ID.isNull() && is_setting_texture) { if (!comboShiny->itemExists(USE_TEXTURE)) { @@ -2124,12 +2126,12 @@ void LLPanelFace::updateShinyControls(LLUICtrl* ctrl, void* userdata, bool mess_ LLColorSwatchCtrl* mShinyColorSwatch = self->getChild<LLColorSwatchCtrl>("shinycolorswatch"); if(mShinyColorSwatch) { - // Doing sets in a getState func causes the 'blinking updates' of swatch colors....DON'T. - // LL_DEBUGS("Materials") << "Resetting specular color to default of white" << LL_ENDL; mShinyColorSwatch->setOriginal(LLColor4::white); mShinyColorSwatch->set(LLColor4::white, TRUE); } + self->getChild<LLUICtrl>("glossiness")->setValue(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT); + self->getChild<LLUICtrl>("environment")->setValue(0); } comboShiny->setSimple(USE_TEXTURE); } @@ -2161,7 +2163,7 @@ void LLPanelFace::updateShinyControls(LLUICtrl* ctrl, void* userdata, bool mess_ } // static -void LLPanelFace::updateBumpyControls(LLUICtrl* ctrl, void* userdata, bool mess_with_combobox) +void LLPanelFace::updateBumpyControls(LLUICtrl* ctrl, void* userdata, bool is_setting_texture, bool mess_with_combobox) { LLPanelFace* self = (LLPanelFace*) userdata; LLTextureCtrl* texture_ctrl = self->getChild<LLTextureCtrl>("bumpytexture control"); @@ -2175,7 +2177,11 @@ void LLPanelFace::updateBumpyControls(LLUICtrl* ctrl, void* userdata, bool mess_ if (mess_with_combobox) { - if (!bumpy_texture_ID.isNull()) + LLTextureCtrl* texture_ctrl = self->getChild<LLTextureCtrl>("bumpytexture control"); + LLUUID bumpy_texture_ID = texture_ctrl->getImageAssetID(); + LL_DEBUGS("Materials") << "texture: " << bumpy_texture_ID << (mess_with_combobox ? "" : " do not") << " update combobox" << LL_ENDL; + + if (!bumpy_texture_ID.isNull() && is_setting_texture) { if (!comboBumpy->itemExists(USE_TEXTURE)) { @@ -2204,7 +2210,7 @@ void LLPanelFace::onCommitShiny(LLUICtrl* ctrl, void* userdata) // Need 'true' here to insure that the 'Use Texture' choice is removed // when we select something other than a spec texture // - updateShinyControls(combo_shiny,self, true); + updateShinyControls(combo_shiny,self, false, true); self->updateMaterial(); } @@ -2298,34 +2304,50 @@ void LLPanelFace::onSelectTexture(const LLSD& data) sendTexture(); } -void LLPanelFace::onCommitMaterialTexture( const LLSD& data ) +void LLPanelFace::onCommitSpecularTexture( const LLSD& data ) { LL_DEBUGS("Materials") << data << LL_ENDL; - updateMaterial(); LLComboBox* combo_shiny = getChild<LLComboBox>("combobox shininess"); - updateShinyControls(combo_shiny,this, true); + updateShinyControls(combo_shiny,this, true, true); + updateMaterial(); +} + +void LLPanelFace::onCommitNormalTexture( const LLSD& data ) +{ + LL_DEBUGS("Materials") << data << LL_ENDL; LLComboBox* combo_bumpy = getChild<LLComboBox>("combobox bumpiness"); - updateBumpyControls(combo_bumpy,this, true); + updateBumpyControls(combo_bumpy, this, true, true); + updateMaterial(); } -void LLPanelFace::onCancelMaterialTexture(const LLSD& data) +void LLPanelFace::onCancelSpecularTexture(const LLSD& data) { - // not sure what to do here other than updateMaterial(); LLComboBox* combo_shiny = getChild<LLComboBox>("combobox shininess"); - updateShinyControls(combo_shiny,this, true); + updateShinyControls(combo_shiny,this, false, true); +} + +void LLPanelFace::onCancelNormalTexture(const LLSD& data) +{ + updateMaterial(); LLComboBox* combo_bumpy = getChild<LLComboBox>("combobox bumpiness"); - updateBumpyControls(combo_bumpy,this, true); + updateBumpyControls(combo_bumpy,this, false, true); } -void LLPanelFace::onSelectMaterialTexture(const LLSD& data) +void LLPanelFace::onSelectSpecularTexture(const LLSD& data) { LL_DEBUGS("Materials") << data << LL_ENDL; updateMaterial(); LLComboBox* combo_shiny = getChild<LLComboBox>("combobox shininess"); - updateShinyControls(combo_shiny,this, true); + updateShinyControls(combo_shiny,this, true, true); +} + +void LLPanelFace::onSelectNormalTexture(const LLSD& data) +{ + LL_DEBUGS("Materials") << data << LL_ENDL; LLComboBox* combo_bumpy = getChild<LLComboBox>("combobox bumpiness"); - updateBumpyControls(combo_bumpy,this, true); + updateBumpyControls(combo_bumpy,this, true, true); + updateMaterial(); } //static diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 2138319365..7fbeef223b 100644 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -76,9 +76,12 @@ protected: void onCommitTexture(const LLSD& data); void onCancelTexture(const LLSD& data); void onSelectTexture(const LLSD& data); - void onCommitMaterialTexture(const LLSD& data); - void onCancelMaterialTexture(const LLSD& data); - void onSelectMaterialTexture(const LLSD& data); + void onCommitSpecularTexture(const LLSD& data); + void onCancelSpecularTexture(const LLSD& data); + void onSelectSpecularTexture(const LLSD& data); + void onCommitNormalTexture(const LLSD& data); + void onCancelNormalTexture(const LLSD& data); + void onSelectNormalTexture(const LLSD& data); void onCommitColor(const LLSD& data); void onCommitShinyColor(const LLSD& data); void onCommitAlpha(const LLSD& data); @@ -93,8 +96,8 @@ protected: static void onCommitMaterialType( LLUICtrl* ctrl, void* userdata); static void onCommitBump( LLUICtrl* ctrl, void* userdata); static void onCommitTexGen( LLUICtrl* ctrl, void* userdata); - static void updateShinyControls( LLUICtrl* ctrl, void* userdata, bool mess_with_combobox = false); - static void updateBumpyControls( LLUICtrl* ctrl, void* userdata, bool mess_with_combobox = false); + static void updateShinyControls( LLUICtrl* ctrl, void* userdata, bool is_setting_texture = false, bool mess_with_combobox = false); + static void updateBumpyControls( LLUICtrl* ctrl, void* userdata, bool is_setting_texture = false, bool mess_with_combobox = false); static void onCommitShiny( LLUICtrl* ctrl, void* userdata); static void updateAlphaControls( LLUICtrl* ctrl, void* userdata); static void onCommitAlphaMode( LLUICtrl* ctrl, void* userdata); |