Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
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
Alchemy Viewer
Alchemy Viewer
Commits
dd4f75a7
Commit
dd4f75a7
authored
11 years ago
by
Richard Linden
Browse files
Options
Downloads
Plain Diff
merge
parents
e6110bb1
a868b7ed
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
indra/newview/llvieweroctree.h
+1
-0
1 addition, 0 deletions
indra/newview/llvieweroctree.h
indra/newview/llvocache.cpp
+26
-6
26 additions, 6 deletions
indra/newview/llvocache.cpp
indra/newview/llvocache.h
+1
-1
1 addition, 1 deletion
indra/newview/llvocache.h
with
28 additions
and
7 deletions
indra/newview/llvieweroctree.h
+
1
−
0
View file @
dd4f75a7
...
@@ -305,6 +305,7 @@ class LLOcclusionCullingGroup : public LLViewerOctreeGroup
...
@@ -305,6 +305,7 @@ class LLOcclusionCullingGroup : public LLViewerOctreeGroup
void
checkOcclusion
();
//read back last occlusion query (if any)
void
checkOcclusion
();
//read back last occlusion query (if any)
void
doOcclusion
(
LLCamera
*
camera
,
const
LLVector4a
*
shift
=
NULL
);
//issue occlusion query
void
doOcclusion
(
LLCamera
*
camera
,
const
LLVector4a
*
shift
=
NULL
);
//issue occlusion query
BOOL
isOcclusionState
(
U32
state
)
const
{
return
mOcclusionState
[
LLViewerCamera
::
sCurCameraID
]
&
state
?
TRUE
:
FALSE
;
}
BOOL
isOcclusionState
(
U32
state
)
const
{
return
mOcclusionState
[
LLViewerCamera
::
sCurCameraID
]
&
state
?
TRUE
:
FALSE
;
}
U32
getOcclusionState
()
const
{
return
mOcclusionState
[
LLViewerCamera
::
sCurCameraID
];}
BOOL
needsUpdate
();
BOOL
needsUpdate
();
U32
getLastOcclusionIssuedTime
();
U32
getLastOcclusionIssuedTime
();
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llvocache.cpp
+
26
−
6
View file @
dd4f75a7
...
@@ -412,7 +412,7 @@ bool LLVOCacheEntry::isAnyVisible(const LLVector4a& camera_origin, const LLVecto
...
@@ -412,7 +412,7 @@ bool LLVOCacheEntry::isAnyVisible(const LLVector4a& camera_origin, const LLVecto
}
}
//within the back sphere
//within the back sphere
if
(
!
vis
&&
!
mParentID
)
if
(
!
vis
&&
!
mParentID
&&
!
group
->
isOcclusionState
(
LLOcclusionCullingGroup
::
OCCLUDED
)
)
{
{
LLVector4a
lookAt
;
LLVector4a
lookAt
;
...
@@ -738,12 +738,28 @@ class LLVOCacheOctreeCull : public LLViewerOctreeCull
...
@@ -738,12 +738,28 @@ class LLVOCacheOctreeCull : public LLViewerOctreeCull
class
LLVOCacheOctreeBackCull
:
public
LLViewerOctreeCull
class
LLVOCacheOctreeBackCull
:
public
LLViewerOctreeCull
{
{
public:
public:
LLVOCacheOctreeBackCull
(
LLCamera
*
camera
,
const
LLVector3
&
shift
,
LLViewerRegion
*
regionp
,
F32
pixel_threshold
)
LLVOCacheOctreeBackCull
(
LLCamera
*
camera
,
const
LLVector3
&
shift
,
LLViewerRegion
*
regionp
,
F32
pixel_threshold
,
bool
use_occlusion
)
:
LLViewerOctreeCull
(
camera
),
mRegionp
(
regionp
),
mPixelThreshold
(
pixel_threshold
)
:
LLViewerOctreeCull
(
camera
),
mRegionp
(
regionp
),
mPixelThreshold
(
pixel_threshold
)
,
mUseObjectCacheOcclusion
(
use_occlusion
)
{
{
mLocalShift
=
shift
;
mLocalShift
=
shift
;
mSphereRadius
=
LLVOCacheEntry
::
sRearFarRadius
;
mSphereRadius
=
LLVOCacheEntry
::
sRearFarRadius
;
}
}
virtual
bool
earlyFail
(
LLViewerOctreeGroup
*
base_group
)
{
if
(
mUseObjectCacheOcclusion
&&
base_group
->
getOctreeNode
()
->
getParent
())
//never occlusion cull the root node
{
LLOcclusionCullingGroup
*
group
=
(
LLOcclusionCullingGroup
*
)
base_group
;
if
(
group
->
getOcclusionState
()
>
0
)
//occlusion state is not clear.
{
return
true
;
}
}
return
false
;
}
virtual
S32
frustumCheck
(
const
LLViewerOctreeGroup
*
group
)
virtual
S32
frustumCheck
(
const
LLViewerOctreeGroup
*
group
)
{
{
...
@@ -781,9 +797,10 @@ class LLVOCacheOctreeBackCull : public LLViewerOctreeCull
...
@@ -781,9 +797,10 @@ class LLVOCacheOctreeBackCull : public LLViewerOctreeCull
LLViewerRegion
*
mRegionp
;
LLViewerRegion
*
mRegionp
;
LLVector3
mLocalShift
;
//shift vector from agent space to local region space.
LLVector3
mLocalShift
;
//shift vector from agent space to local region space.
F32
mPixelThreshold
;
F32
mPixelThreshold
;
bool
mUseObjectCacheOcclusion
;
};
};
void
LLVOCachePartition
::
selectBackObjects
(
LLCamera
&
camera
,
F32
pixel_threshold
)
void
LLVOCachePartition
::
selectBackObjects
(
LLCamera
&
camera
,
F32
pixel_threshold
,
bool
use_occlusion
)
{
{
if
(
LLViewerCamera
::
sCurCameraID
!=
LLViewerCamera
::
CAMERA_WORLD
)
if
(
LLViewerCamera
::
sCurCameraID
!=
LLViewerCamera
::
CAMERA_WORLD
)
{
{
...
@@ -804,7 +821,7 @@ void LLVOCachePartition::selectBackObjects(LLCamera &camera, F32 pixel_threshold
...
@@ -804,7 +821,7 @@ void LLVOCachePartition::selectBackObjects(LLCamera &camera, F32 pixel_threshold
//localize the camera
//localize the camera
LLVector3
region_agent
=
mRegionp
->
getOriginAgent
();
LLVector3
region_agent
=
mRegionp
->
getOriginAgent
();
LLVOCacheOctreeBackCull
culler
(
&
camera
,
region_agent
,
mRegionp
,
pixel_threshold
);
LLVOCacheOctreeBackCull
culler
(
&
camera
,
region_agent
,
mRegionp
,
pixel_threshold
,
use_occlusion
);
culler
.
traverse
(
mOctree
);
culler
.
traverse
(
mOctree
);
mBackSlectionEnabled
--
;
mBackSlectionEnabled
--
;
...
@@ -855,7 +872,10 @@ S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion)
...
@@ -855,7 +872,10 @@ S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion)
if
(
LLViewerOctreeEntryData
::
getCurrentFrame
()
%
seed
!=
mIdleHash
)
if
(
LLViewerOctreeEntryData
::
getCurrentFrame
()
%
seed
!=
mIdleHash
)
{
{
mFrontCull
=
FALSE
;
mFrontCull
=
FALSE
;
selectBackObjects
(
camera
,
LLVOCacheEntry
::
getSquaredPixelThreshold
(
mFrontCull
));
//process back objects selection
//process back objects selection
selectBackObjects
(
camera
,
LLVOCacheEntry
::
getSquaredPixelThreshold
(
mFrontCull
),
do_occlusion
&&
use_object_cache_occlusion
);
return
0
;
//nothing changed, reduce frequency of culling
return
0
;
//nothing changed, reduce frequency of culling
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
indra/newview/llvocache.h
+
1
−
1
View file @
dd4f75a7
...
@@ -195,7 +195,7 @@ class LLVOCachePartition : public LLViewerOctreePartition, public LLTrace::MemTr
...
@@ -195,7 +195,7 @@ class LLVOCachePartition : public LLViewerOctreePartition, public LLTrace::MemTr
bool
isFrontCull
()
const
{
return
mFrontCull
;}
bool
isFrontCull
()
const
{
return
mFrontCull
;}
private
:
private
:
void
selectBackObjects
(
LLCamera
&
camera
,
F32
projection_area_cutoff
);
//select objects behind camera.
void
selectBackObjects
(
LLCamera
&
camera
,
F32
projection_area_cutoff
,
bool
use_occlusion
);
//select objects behind camera.
public
:
public
:
static
BOOL
sNeedsOcclusionCheck
;
static
BOOL
sNeedsOcclusionCheck
;
...
...
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