Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
JennaHuntsman
XDG Integration
Commits
8997eb45
Commit
8997eb45
authored
3 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Small opt to tree code to reduce many map finds
parent
c8d4472e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/llvotree.cpp
+27
-26
27 additions, 26 deletions
indra/newview/llvotree.cpp
with
27 additions
and
26 deletions
indra/newview/llvotree.cpp
+
27
−
26
View file @
8997eb45
...
@@ -304,35 +304,34 @@ U32 LLVOTree::processUpdateMessage(LLMessageSystem *mesgsys,
...
@@ -304,35 +304,34 @@ U32 LLVOTree::processUpdateMessage(LLMessageSystem *mesgsys,
mSpecies
=
((
U8
*
)
mData
)[
0
];
mSpecies
=
((
U8
*
)
mData
)[
0
];
}
}
if
(
!
sSpeciesTable
.
count
(
mSpecies
))
if
(
!
sSpeciesTable
.
empty
()
&&
!
sSpeciesTable
.
count
(
mSpecies
))
{
{
if
(
sSpeciesTable
.
size
())
SpeciesMap
::
const_iterator
it
=
sSpeciesTable
.
begin
();
{
mSpecies
=
(
*
it
).
first
;
SpeciesMap
::
const_iterator
it
=
sSpeciesTable
.
begin
();
mSpecies
=
(
*
it
).
first
;
}
}
}
//
//
// Load Species-Specific data
// Load Species-Specific data
//
//
auto
species_data
=
sSpeciesTable
[
mSpecies
];
static
const
S32
MAX_TREE_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL
=
32
;
//frames.
static
const
S32
MAX_TREE_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL
=
32
;
//frames.
mTreeImagep
=
LLViewerTextureManager
::
getFetchedTexture
(
s
S
pecies
Table
[
mSpecies
]
->
mTextureID
,
FTT_DEFAULT
,
TRUE
,
LLGLTexture
::
BOOST_NONE
,
LLViewerTexture
::
LOD_TEXTURE
);
mTreeImagep
=
LLViewerTextureManager
::
getFetchedTexture
(
species
_data
->
mTextureID
,
FTT_DEFAULT
,
TRUE
,
LLGLTexture
::
BOOST_NONE
,
LLViewerTexture
::
LOD_TEXTURE
);
mTreeImagep
->
setMaxVirtualSizeResetInterval
(
MAX_TREE_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL
);
//allow to wait for at most 16 frames to reset virtual size.
mTreeImagep
->
setMaxVirtualSizeResetInterval
(
MAX_TREE_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL
);
//allow to wait for at most 16 frames to reset virtual size.
mBranchLength
=
s
S
pecies
Table
[
mSpecies
]
->
mBranchLength
;
mBranchLength
=
species
_data
->
mBranchLength
;
mTrunkLength
=
s
S
pecies
Table
[
mSpecies
]
->
mTrunkLength
;
mTrunkLength
=
species
_data
->
mTrunkLength
;
mLeafScale
=
s
S
pecies
Table
[
mSpecies
]
->
mLeafScale
;
mLeafScale
=
species
_data
->
mLeafScale
;
mDroop
=
s
S
pecies
Table
[
mSpecies
]
->
mDroop
;
mDroop
=
species
_data
->
mDroop
;
mTwist
=
s
S
pecies
Table
[
mSpecies
]
->
mTwist
;
mTwist
=
species
_data
->
mTwist
;
mBranches
=
s
S
pecies
Table
[
mSpecies
]
->
mBranches
;
mBranches
=
species
_data
->
mBranches
;
mDepth
=
s
S
pecies
Table
[
mSpecies
]
->
mDepth
;
mDepth
=
species
_data
->
mDepth
;
mScaleStep
=
s
S
pecies
Table
[
mSpecies
]
->
mScaleStep
;
mScaleStep
=
species
_data
->
mScaleStep
;
mTrunkDepth
=
s
S
pecies
Table
[
mSpecies
]
->
mTrunkDepth
;
mTrunkDepth
=
species
_data
->
mTrunkDepth
;
mBillboardScale
=
s
S
pecies
Table
[
mSpecies
]
->
mBillboardScale
;
mBillboardScale
=
species
_data
->
mBillboardScale
;
mBillboardRatio
=
s
S
pecies
Table
[
mSpecies
]
->
mBillboardRatio
;
mBillboardRatio
=
species
_data
->
mBillboardRatio
;
mTrunkAspect
=
s
S
pecies
Table
[
mSpecies
]
->
mTrunkAspect
;
mTrunkAspect
=
species
_data
->
mTrunkAspect
;
mBranchAspect
=
s
S
pecies
Table
[
mSpecies
]
->
mBranchAspect
;
mBranchAspect
=
species
_data
->
mBranchAspect
;
// position change not caused by us, etc. make sure to rebuild.
// position change not caused by us, etc. make sure to rebuild.
gPipeline
.
markRebuild
(
mDrawable
,
LLDrawable
::
REBUILD_ALL
);
gPipeline
.
markRebuild
(
mDrawable
,
LLDrawable
::
REBUILD_ALL
);
...
@@ -716,12 +715,14 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
...
@@ -716,12 +715,14 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
// Generate the vertices
// Generate the vertices
// Generate the indices
// Generate the indices
auto
species_data
=
sSpeciesTable
[
mSpecies
];
for
(
lod
=
0
;
lod
<
sMAX_NUM_TREE_LOD_LEVELS
;
lod
++
)
for
(
lod
=
0
;
lod
<
sMAX_NUM_TREE_LOD_LEVELS
;
lod
++
)
{
{
slices
=
sLODSlices
[
lod
];
slices
=
sLODSlices
[
lod
];
F32
base_radius
=
0.65
f
;
F32
base_radius
=
0.65
f
;
F32
top_radius
=
base_radius
*
s
S
pecies
Table
[
mSpecies
]
->
mTaper
;
F32
top_radius
=
base_radius
*
species
_data
->
mTaper
;
//LL_INFOS() << "Species " << ((U32) mSpecies) << ", taper = " << s
S
pecies
Table[mSpecies]
.mTaper << LL_ENDL;
//LL_INFOS() << "Species " << ((U32) mSpecies) << ", taper = " << species
_data
.mTaper << LL_ENDL;
//LL_INFOS() << "Droop " << mDroop << ", branchlength: " << mBranchLength << LL_ENDL;
//LL_INFOS() << "Droop " << mDroop << ", branchlength: " << mBranchLength << LL_ENDL;
F32
angle
=
0
;
F32
angle
=
0
;
F32
angle_inc
=
360.
f
/
(
slices
-
1
);
F32
angle_inc
=
360.
f
/
(
slices
-
1
);
...
@@ -734,16 +735,16 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
...
@@ -734,16 +735,16 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
F32
radius
=
base_radius
;
F32
radius
=
base_radius
;
F32
x1
,
y1
;
F32
x1
,
y1
;
F32
noise_scale
=
s
S
pecies
Table
[
mSpecies
]
->
mNoiseMag
;
F32
noise_scale
=
species
_data
->
mNoiseMag
;
LLVector3
nvec
;
LLVector3
nvec
;
const
F32
cap_nudge
=
0.1
f
;
// Height to 'peak' the caps on top/bottom of branch
const
F32
cap_nudge
=
0.1
f
;
// Height to 'peak' the caps on top/bottom of branch
const
S32
fractal_depth
=
5
;
const
S32
fractal_depth
=
5
;
F32
nvec_scale
=
1.
f
*
s
S
pecies
Table
[
mSpecies
]
->
mNoiseScale
;
F32
nvec_scale
=
1.
f
*
species
_data
->
mNoiseScale
;
F32
nvec_scalez
=
4.
f
*
s
S
pecies
Table
[
mSpecies
]
->
mNoiseScale
;
F32
nvec_scalez
=
4.
f
*
species
_data
->
mNoiseScale
;
F32
tex_z_repeat
=
s
S
pecies
Table
[
mSpecies
]
->
mRepeatTrunkZ
;
F32
tex_z_repeat
=
species
_data
->
mRepeatTrunkZ
;
F32
start_radius
;
F32
start_radius
;
F32
nangle
=
0
;
F32
nangle
=
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment