Merge remote branch 'shyotl/master'

This commit is contained in:
Siana Gearz
2010-11-18 23:53:59 +01:00
4 changed files with 19 additions and 11 deletions

View File

@@ -9,7 +9,7 @@
<tree name="Palm 2" species_id="6" texture_id="2d784476-d0db-9979-0cff-9408745a7cf3" droop="0.0" twist="0.0" branches="3.0" depth="1" scale_step="0.5" trunk_depth="0" branch_length="0.7" trunk_length="10.0" leaf_scale="7.5" billboard_scale="13.5" billboard_ratio="1.0" trunk_aspect="0.035" branch_aspect="0.03" leaf_rotate="0.0" noise_mag="0.2" noise_scale="6.0" taper="0.6" repeat_z="12" />
<tree name="Cypress 1" species_id="7" texture_id="fb2ae204-3fd1-df33-594f-c9f882830e66" droop="30.0" twist="0.0" branches="3.0" depth="4" scale_step="0.5" trunk_depth="0" branch_length="10.0" trunk_length="10.0" leaf_scale="70.0" billboard_scale="22.5" billboard_ratio="1.0" trunk_aspect="0.05" branch_aspect="0.03" leaf_rotate="0.0" noise_mag="1.2" noise_scale="1.0" taper="0.5" repeat_z="6" />
<tree name="Cypress 2" species_id="8" texture_id="30047cec-269d-408e-0c30-b2603b887268" droop="30.0" twist="0.0" branches="3.0" depth="4" scale_step="0.6" trunk_depth="3.0" branch_length="7.5" trunk_length="10.0" leaf_scale="35.0" billboard_scale="25.0" billboard_ratio="0.8" trunk_aspect="0.05" branch_aspect="0.04" leaf_rotate="0.0" noise_mag="1.2" noise_scale="1.0" taper="0.5" repeat_z="5" />
<tree name="Pine 2" species_id="9" texture_id="d691a01c-13b7-578d-57c0-5caef0b4e7e1" droop="50.0" twist="7.5" branches="4.0" depth="2" scale_step="0.7" trunk_depth="6.0" branch_length="6.0" trunk_length="10.0" leaf_scale="15.5" billboard_scale="33.0" billboard_ratio="1.35" trunk_aspect="0.1" branch_aspect="0.08" leaf_rotate="5.0" noise_mag="0.5" noise_scale="2.5" taper="0.7" repeat_z="3" />
<tree name="Pine 2" species_id="9" texture_id="d691a01c-13b7-578d-57c0-5caef0b4e7e1" droop="50.0" twist="7.5" branches="4.0" depth="2" scale_step="0.7" trunk_depth="6.0" branch_length="6.0" trunk_length="10.0" leaf_scale="15.5" billboard_scale="28.0" billboard_ratio="1.35" trunk_aspect="0.1" branch_aspect="0.08" leaf_rotate="5.0" noise_mag="0.5" noise_scale="2.5" taper="0.7" repeat_z="3" />
<tree name="Plumeria" species_id="10" texture_id="6de37e4e-7029-61f5-54b8-f5e63f983f58" droop="8.0" twist="7.0" branches="3.0" depth="2" scale_step="0.6" trunk_depth="0" branch_length="3.0" trunk_length="0.1" leaf_scale="20" billboard_scale="10.0" billboard_ratio="1.35" trunk_aspect="0.10" branch_aspect="0.075" leaf_rotate="0.0" noise_mag="0" noise_scale="0" taper="0.85" repeat_z="2" />
<tree name="Winter Pine 1" species_id="11" texture_id="10d2a01a-0818-84b9-4b96-c2eb63256519" droop="90.0" twist="2.5" branches="6.0" depth="1" scale_step="0.66" trunk_depth="8" branch_length="0.0" trunk_length="4" leaf_scale="6.75" billboard_scale="12.5" billboard_ratio="0.6" trunk_aspect="0.1" branch_aspect="0.05" leaf_rotate="0.0" noise_mag="0.0" noise_scale="2.5" taper="0.85" repeat_z="2" />
<tree name="Winter Aspen" species_id="12" texture_id="7c0cf89b-44b1-1ce2-dd74-07102a98ac2a" droop="85.0" twist="3.0" branches="5" depth="1" scale_step="0.6" trunk_depth="8" branch_length="3.0" trunk_length="4.5" leaf_scale="8" billboard_scale="12" billboard_ratio=".675" trunk_aspect="0.06" branch_aspect="0.05" leaf_rotate="0.0" noise_mag="0.75" noise_scale="2.5" taper="0.8" repeat_z="2" />

View File

@@ -102,7 +102,8 @@ void LLDrawPoolTree::render(S32 pass)
LLGLEnable test(GL_ALPHA_TEST);
LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f);
if (gSavedSettings.getBOOL("RenderAnimateTrees"))
LLCachedControl<bool> render_animate_trees("RenderAnimateTrees",false);
if (render_animate_trees)
{
renderTree();
}
@@ -198,7 +199,8 @@ void LLDrawPoolTree::renderForSelect()
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA);
if (gSavedSettings.getBOOL("RenderAnimateTrees"))
LLCachedControl<bool> render_animate_trees("RenderAnimateTrees",false);
if (render_animate_trees)
{
renderTree(TRUE);
}
@@ -319,8 +321,8 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
scale_mat *= rot_mat;
const F32 THRESH_ANGLE_FOR_BILLBOARD = 15.f;
const F32 BLEND_RANGE_FOR_BILLBOARD = 3.f;
const F32 THRESH_ANGLE_FOR_BILLBOARD = 7.5f; //Made LoD now a little less aggressive here -Shyotl
/*const F32 BLEND_RANGE_FOR_BILLBOARD = 1.5f;*/ //Unused, really
F32 droop = treep->mDroop + 25.f*(1.f - treep->mTrunkBend.magVec());
@@ -339,7 +341,7 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
}
}
if (app_angle < (THRESH_ANGLE_FOR_BILLBOARD - BLEND_RANGE_FOR_BILLBOARD))
if (app_angle < (THRESH_ANGLE_FOR_BILLBOARD/* - BLEND_RANGE_FOR_BILLBOARD*/))
{
//
// Draw only the billboard
@@ -354,7 +356,6 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
//
// Draw only the full geometry tree
//
//stop_depth = (app_angle < THRESH_ANGLE_FOR_RECURSION_REDUCTION);
LLFacePool::LLOverrideFaceColor clr(this, color);
indices_drawn += treep->drawBranchPipeline(scale_mat, indicesp, trunk_LOD, stop_depth, treep->mDepth, treep->mTrunkDepth, 1.0, treep->mTwist, droop, treep->mBranches, alpha);
}

View File

@@ -141,6 +141,8 @@ void LLFloaterSettingsDebug::onCommitSettings(LLUICtrl* ctrl, void* user_data)
LLComboBox* settings_combo = floaterp->getChild<LLComboBox>("settings_combo");
LLControlVariable* controlp = (LLControlVariable*)settings_combo->getCurrentUserdata();
controlp = controlp ? controlp->getCOAActive() : NULL;
if(!controlp)//Uh oh!
return;
LLVector3 vector;
LLVector3d vectord;

View File

@@ -350,7 +350,8 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
}
//it's cheaper to check if wind is enabled first
if (gLLWindEnabled && gSavedSettings.getBOOL("RenderAnimateTrees"))
LLCachedControl<bool> render_animate_trees("RenderAnimateTrees",false);
if (gLLWindEnabled && render_animate_trees)
{
F32 mass_inv;
@@ -393,7 +394,7 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
}
}
if (!gLLWindEnabled || !gSavedSettings.getBOOL("RenderAnimateTrees"))
if (!gLLWindEnabled || !render_animate_trees)
{
if (mReferenceBuffer.isNull())
{
@@ -539,7 +540,8 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
max_vertices += sLODVertexCount[lod];
}
mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, gSavedSettings.getBOOL("RenderAnimateTrees") ? GL_STATIC_DRAW_ARB : 0);
LLCachedControl<bool> render_animate_trees("RenderAnimateTrees",false);
mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, render_animate_trees ? GL_STATIC_DRAW_ARB : 0);
mReferenceBuffer->allocateBuffer(max_vertices, max_indices, TRUE);
LLStrider<LLVector3> vertices;
@@ -843,7 +845,10 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
llassert(index_count == max_indices);
}
if (gLLWindEnabled || gSavedSettings.getBOOL("RenderAnimateTrees"))
LLCachedControl<bool> render_animate_trees("RenderAnimateTrees",false);
//Ignoring gLLWindEnabled fixes vanishing trees when wind is disabled but anim trees are enabled.
//Using an && here is incorrect, and will cause instability.
if (/*gLLWindEnabled || */render_animate_trees)
{
mDrawable->getFace(0)->mVertexBuffer = mReferenceBuffer;
}