Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Black Dragon Viewer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
NiranV
Black Dragon Viewer
Commits
663a6dc2
Commit
663a6dc2
authored
Sep 28, 2020
by
Andrey Kleshchev
Browse files
Options
Browse Files
Download
Plain Diff
Merged master(DRTVWR-497) into DRTVWR-482
parents
89839721
bac6652c
Changes
80
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
80 changed files
with
2938 additions
and
3007 deletions
+2938
-3007
.clang-format
.clang-format
+19
-18
indra/cmake/00-Common.cmake
indra/cmake/00-Common.cmake
+7
-1
indra/edit-me-to-trigger-new-build.txt
indra/edit-me-to-trigger-new-build.txt
+1
-0
indra/llinventory/llsettingssky.cpp
indra/llinventory/llsettingssky.cpp
+3
-0
indra/llrender/llimagegl.cpp
indra/llrender/llimagegl.cpp
+49
-31
indra/llrender/llrender.cpp
indra/llrender/llrender.cpp
+50
-38
indra/llrender/llrendertarget.cpp
indra/llrender/llrendertarget.cpp
+5
-5
indra/llrender/llshadermgr.cpp
indra/llrender/llshadermgr.cpp
+1
-1
indra/newview/VIEWER_VERSION.txt
indra/newview/VIEWER_VERSION.txt
+1
-1
indra/newview/app_settings/settings.xml
indra/newview/app_settings/settings.xml
+0
-11
indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
...newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+135
-145
indra/newview/app_settings/shaders/class1/deferred/fullbrightShinyF.glsl
...pp_settings/shaders/class1/deferred/fullbrightShinyF.glsl
+34
-15
indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
...wview/app_settings/shaders/class1/deferred/materialF.glsl
+443
-439
indra/newview/app_settings/shaders/class1/deferred/moonF.glsl
...a/newview/app_settings/shaders/class1/deferred/moonF.glsl
+19
-20
indra/newview/app_settings/shaders/class1/deferred/moonV.glsl
...a/newview/app_settings/shaders/class1/deferred/moonV.glsl
+3
-8
indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
...pp_settings/shaders/class1/deferred/multiPointLightF.glsl
+98
-105
indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+85
-97
indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
...ew/app_settings/shaders/class1/deferred/softenLightF.glsl
+4
-30
indra/newview/app_settings/shaders/class1/environment/encodeNormF.glsl
.../app_settings/shaders/class1/environment/encodeNormF.glsl
+3
-0
indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
...app_settings/shaders/class1/lighting/lightAlphaMaskF.glsl
+11
-5
indra/newview/app_settings/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
...gs/shaders/class1/lighting/lightFullbrightAlphaMaskF.glsl
+15
-4
indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl
...pp_settings/shaders/class1/lighting/lightFullbrightF.glsl
+9
-3
indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl
...ttings/shaders/class1/lighting/lightFullbrightShinyF.glsl
+22
-5
indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
.../newview/app_settings/shaders/class1/objects/simpleV.glsl
+18
-11
indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl
..._settings/shaders/class1/windlight/atmosphericsFuncs.glsl
+74
-94
indra/newview/app_settings/shaders/class1/windlight/moonF.glsl
.../newview/app_settings/shaders/class1/windlight/moonF.glsl
+17
-15
indra/newview/app_settings/shaders/class1/windlight/moonV.glsl
.../newview/app_settings/shaders/class1/windlight/moonV.glsl
+2
-7
indra/newview/app_settings/shaders/class2/deferred/skyF.glsl
indra/newview/app_settings/shaders/class2/deferred/skyF.glsl
+65
-84
indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
...ew/app_settings/shaders/class2/deferred/softenLightF.glsl
+75
-118
indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
...ewview/app_settings/shaders/class2/windlight/cloudsV.glsl
+135
-142
indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
...a/newview/app_settings/shaders/class2/windlight/skyV.glsl
+86
-98
indra/newview/llappviewer.cpp
indra/newview/llappviewer.cpp
+2
-34
indra/newview/llappviewer.h
indra/newview/llappviewer.h
+1
-6
indra/newview/lldrawable.cpp
indra/newview/lldrawable.cpp
+50
-5
indra/newview/lldrawpool.cpp
indra/newview/lldrawpool.cpp
+3
-12
indra/newview/lldrawpool.h
indra/newview/lldrawpool.h
+1
-2
indra/newview/lldrawpoolavatar.cpp
indra/newview/lldrawpoolavatar.cpp
+5
-14
indra/newview/lldrawpoolavatar.h
indra/newview/lldrawpoolavatar.h
+1
-3
indra/newview/lldrawpoolground.cpp
indra/newview/lldrawpoolground.cpp
+0
-5
indra/newview/lldrawpoolground.h
indra/newview/lldrawpoolground.h
+0
-2
indra/newview/lldrawpoolsky.cpp
indra/newview/lldrawpoolsky.cpp
+0
-16
indra/newview/lldrawpoolsky.h
indra/newview/lldrawpoolsky.h
+0
-2
indra/newview/lldrawpoolterrain.cpp
indra/newview/lldrawpoolterrain.cpp
+0
-7
indra/newview/lldrawpoolterrain.h
indra/newview/lldrawpoolterrain.h
+0
-2
indra/newview/lldrawpooltree.cpp
indra/newview/lldrawpooltree.cpp
+0
-5
indra/newview/lldrawpooltree.h
indra/newview/lldrawpooltree.h
+0
-2
indra/newview/lldrawpoolwater.cpp
indra/newview/lldrawpoolwater.cpp
+0
-7
indra/newview/lldrawpoolwater.h
indra/newview/lldrawpoolwater.h
+0
-1
indra/newview/lldrawpoolwlsky.cpp
indra/newview/lldrawpoolwlsky.cpp
+7
-12
indra/newview/lldrawpoolwlsky.h
indra/newview/lldrawpoolwlsky.h
+0
-2
indra/newview/llface.cpp
indra/newview/llface.cpp
+1
-1
indra/newview/llfloaterimcontainer.cpp
indra/newview/llfloaterimcontainer.cpp
+33
-17
indra/newview/llfloaterimcontainer.h
indra/newview/llfloaterimcontainer.h
+4
-0
indra/newview/llfloaterimsessiontab.cpp
indra/newview/llfloaterimsessiontab.cpp
+11
-4
indra/newview/llfloaterimsessiontab.h
indra/newview/llfloaterimsessiontab.h
+1
-1
indra/newview/llgroupmgr.cpp
indra/newview/llgroupmgr.cpp
+16
-2
indra/newview/llpanelface.cpp
indra/newview/llpanelface.cpp
+3
-30
indra/newview/llsettingsvo.cpp
indra/newview/llsettingsvo.cpp
+10
-1
indra/newview/llspatialpartition.cpp
indra/newview/llspatialpartition.cpp
+3
-1
indra/newview/llspatialpartition.h
indra/newview/llspatialpartition.h
+24
-0
indra/newview/lltexturectrl.cpp
indra/newview/lltexturectrl.cpp
+3
-5
indra/newview/lltexturectrl.h
indra/newview/lltexturectrl.h
+0
-1
indra/newview/lltextureview.cpp
indra/newview/lltextureview.cpp
+1
-1
indra/newview/lltoolpie.cpp
indra/newview/lltoolpie.cpp
+1
-1
indra/newview/llviewerdisplay.cpp
indra/newview/llviewerdisplay.cpp
+40
-71
indra/newview/llviewermenu.cpp
indra/newview/llviewermenu.cpp
+4
-0
indra/newview/llviewermessage.cpp
indra/newview/llviewermessage.cpp
+4
-0
indra/newview/llviewerobject.cpp
indra/newview/llviewerobject.cpp
+13
-13
indra/newview/llviewerobject.h
indra/newview/llviewerobject.h
+1
-0
indra/newview/llviewerregion.cpp
indra/newview/llviewerregion.cpp
+26
-2
indra/newview/llviewerregion.h
indra/newview/llviewerregion.h
+8
-0
indra/newview/llvoavatar.cpp
indra/newview/llvoavatar.cpp
+9
-9
indra/newview/llvocache.cpp
indra/newview/llvocache.cpp
+20
-31
indra/newview/llvovolume.cpp
indra/newview/llvovolume.cpp
+26
-2
indra/newview/llvowlsky.cpp
indra/newview/llvowlsky.cpp
+3
-0
indra/newview/llworld.cpp
indra/newview/llworld.cpp
+16
-4
indra/newview/pipeline.cpp
indra/newview/pipeline.cpp
+1084
-1117
indra/newview/pipeline.h
indra/newview/pipeline.h
+2
-1
indra/newview/skins/default/xui/en/menu_viewer.xml
indra/newview/skins/default/xui/en/menu_viewer.xml
+10
-0
indra/newview/skins/default/xui/en/panel_settings_sky_atmos.xml
...newview/skins/default/xui/en/panel_settings_sky_atmos.xml
+2
-2
No files found.
.clang-format
View file @
663a6dc2
---
# clang-format version 10.0.0+
Language: Cpp
# BasedOnStyle: Microsoft
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros:
fals
e
AlignConsecutiveAssignments:
fals
e
AlignConsecutiveDeclarations:
fals
e
AlignEscapedNewlines:
Righ
t
AlignConsecutiveMacros:
tru
e
AlignConsecutiveAssignments:
tru
e
AlignConsecutiveDeclarations:
tru
e
AlignEscapedNewlines:
Lef
t
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine:
tru
e
AllowAllConstructorInitializersOnNextLine:
tru
e
AllowAllParametersOfDeclarationOnNextLine:
tru
e
AllowAllArgumentsOnNextLine:
fals
e
AllowAllConstructorInitializersOnNextLine:
fals
e
AllowAllParametersOfDeclarationOnNextLine:
fals
e
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
...
...
@@ -29,21 +30,21 @@ BreakBeforeBraces: Allman
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma:
fals
e
BreakConstructorInitializers:
Before
Colon
BreakConstructorInitializersBeforeComma:
tru
e
BreakConstructorInitializers:
After
Colon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 1
2
0
ColumnLimit: 1
4
0
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine:
fals
e
ConstructorInitializerAllOnOneLineOrOnePerLine:
tru
e
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking:
fals
e
ExperimentalAutoDetectBinPacking:
tru
e
FixNamespaceComments: true
ForEachMacros:
- foreach
...
...
@@ -62,18 +63,18 @@ IncludeCategories:
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels:
fals
e
IndentCaseLabels:
tru
e
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks:
tru
e
KeepEmptyLinesAtTheStartOfBlocks:
fals
e
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation:
None
NamespaceIndentation:
Inner
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
...
...
@@ -94,16 +95,16 @@ SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList:
fals
e
SpaceBeforeCpp11BracedList:
tru
e
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments:
1
SpacesBeforeTrailingComments:
2
SpacesInAngles: false
SpacesInContainerLiterals:
tru
e
SpacesInContainerLiterals:
fals
e
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
...
...
indra/cmake/00-Common.cmake
View file @
663a6dc2
...
...
@@ -63,7 +63,13 @@ if (WINDOWS)
# Without PreferredToolArchitecture=x64, as of 2020-06-26 the 32-bit
# compiler on our TeamCity build hosts has started running out of virtual
# memory for the precompiled header file.
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/MP /p:PreferredToolArchitecture=x64"
)
# CP changed to only append the flag for 32bit builds - on 64bit builds,
# locally at least, the build output is spammed with 1000s of 'D9002'
# warnings about this switch being ignored.
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/MP"
)
if
(
ADDRESS_SIZE EQUAL 32
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/p:PreferredToolArchitecture=x64"
)
endif
()
set
(
CMAKE_CXX_FLAGS_RELWITHDEBINFO
"
${
CMAKE_CXX_FLAGS_RELWITHDEBINFO
}
/Zo"
...
...
indra/edit-me-to-trigger-new-build.txt
View file @
663a6dc2
12
indra/llinventory/llsettingssky.cpp
View file @
663a6dc2
...
...
@@ -1295,6 +1295,9 @@ void LLSettingsSky::clampColor(LLColor3& color, F32 gamma, F32 scale) const
color
=
linear
;
}
// Similar/Shared Algorithms:
// indra\llinventory\llsettingssky.cpp -- LLSettingsSky::calculateLightSettings()
// indra\newview\app_settings\shaders\class1\windlight\atmosphericsFuncs.glsl -- calcAtmosphericVars()
void
LLSettingsSky
::
calculateLightSettings
()
const
{
// Initialize temp variables
...
...
indra/llrender/llimagegl.cpp
View file @
663a6dc2
...
...
@@ -985,38 +985,56 @@ BOOL LLImageGL::preAddToAtlas(S32 discard_level, const LLImageRaw* raw_image)
return
FALSE
;
}
if
(
!
mHasExplicitFormat
)
{
switch
(
mComponents
)
{
case
1
:
// Use luminance alpha (for fonts)
mFormatInternal
=
GL_LUMINANCE8
;
mFormatPrimary
=
GL_LUMINANCE
;
mFormatType
=
GL_UNSIGNED_BYTE
;
break
;
case
2
:
// Use luminance alpha (for fonts)
mFormatInternal
=
GL_LUMINANCE8_ALPHA8
;
mFormatPrimary
=
GL_LUMINANCE_ALPHA
;
mFormatType
=
GL_UNSIGNED_BYTE
;
break
;
case
3
:
mFormatInternal
=
GL_RGB8
;
mFormatPrimary
=
GL_RGB
;
mFormatType
=
GL_UNSIGNED_BYTE
;
break
;
case
4
:
mFormatInternal
=
GL_RGBA8
;
mFormatPrimary
=
GL_RGBA
;
mFormatType
=
GL_UNSIGNED_BYTE
;
break
;
default:
LL_ERRS
()
<<
"Bad number of components for texture: "
<<
(
U32
)
getComponents
()
<<
LL_ENDL
;
}
}
if
(
!
mHasExplicitFormat
)
{
switch
(
mComponents
)
{
case
1
:
// Use luminance alpha (for fonts)
mFormatInternal
=
GL_LUMINANCE8
;
mFormatPrimary
=
GL_LUMINANCE
;
mFormatType
=
GL_UNSIGNED_BYTE
;
break
;
case
2
:
// Use luminance alpha (for fonts)
mFormatInternal
=
GL_LUMINANCE8_ALPHA8
;
mFormatPrimary
=
GL_LUMINANCE_ALPHA
;
mFormatType
=
GL_UNSIGNED_BYTE
;
break
;
case
3
:
#if USE_SRGB_DECODE
if
(
gGLManager
.
mHasTexturesRGBDecode
)
{
mFormatInternal
=
GL_SRGB8
;
}
else
#endif
{
mFormatInternal
=
GL_RGB8
;
}
mFormatPrimary
=
GL_RGB
;
mFormatType
=
GL_UNSIGNED_BYTE
;
break
;
case
4
:
#if USE_SRGB_DECODE
if
(
gGLManager
.
mHasTexturesRGBDecode
)
{
mFormatInternal
=
GL_SRGB8_ALPHA8
;
}
else
#endif
{
mFormatInternal
=
GL_RGBA8
;
}
mFormatPrimary
=
GL_RGBA
;
mFormatType
=
GL_UNSIGNED_BYTE
;
break
;
default:
LL_ERRS
()
<<
"Bad number of components for texture: "
<<
(
U32
)
getComponents
()
<<
LL_ENDL
;
}
}
mCurrentDiscardLevel
=
discard_level
;
mCurrentDiscardLevel
=
discard_level
;
mDiscardLevelInAtlas
=
discard_level
;
mTexelsInAtlas
=
raw_image
->
getWidth
()
*
raw_image
->
getHeight
()
;
mLastBindTime
=
sLastFrameTime
;
...
...
indra/llrender/llrender.cpp
View file @
663a6dc2
...
...
@@ -849,26 +849,32 @@ void LLTexUnit::debugTextureUnit(void)
}
}
void
LLTexUnit
::
setTextureColorSpace
(
eTextureColorSpace
space
)
{
void
LLTexUnit
::
setTextureColorSpace
(
eTextureColorSpace
space
)
{
mTexColorSpace
=
space
;
#if USE_SRGB_DECODE
if
(
gGLManager
.
mHasTexturesRGBDecode
)
{
if
(
space
==
TCS_SRGB
)
{
if
(
gGLManager
.
mHasTexturesRGBDecode
)
{
if
(
space
==
TCS_SRGB
)
{
glTexParameteri
(
sGLTextureType
[
mCurrTexType
],
GL_TEXTURE_SRGB_DECODE_EXT
,
GL_DECODE_EXT
);
}
else
{
else
{
glTexParameteri
(
sGLTextureType
[
mCurrTexType
],
GL_TEXTURE_SRGB_DECODE_EXT
,
GL_SKIP_DECODE_EXT
);
}
if
(
gDebugGL
)
{
if
(
gDebugGL
)
{
assert_glerror
();
}
}
else
#endif
glTexParameteri
(
sGLTextureType
[
mCurrTexType
],
GL_TEXTURE_SRGB_DECODE_EXT
,
GL_SKIP_DECODE_EXT
);
{
glTexParameteri
(
sGLTextureType
[
mCurrTexType
],
GL_TEXTURE_SRGB_DECODE_EXT
,
GL_SKIP_DECODE_EXT
);
}
}
LLLightState
::
LLLightState
(
S32
index
)
...
...
@@ -1192,46 +1198,46 @@ void LLRender::refreshState(void)
void
LLRender
::
syncLightState
()
{
LLGLSLShader
*
shader
=
LLGLSLShader
::
sCurBoundShaderPtr
;
LLGLSLShader
*
shader
=
LLGLSLShader
::
sCurBoundShaderPtr
;
if
(
!
shader
)
{
return
;
}
if
(
!
shader
)
{
return
;
}
if
(
shader
->
mLightHash
!=
mLightHash
)
{
shader
->
mLightHash
=
mLightHash
;
if
(
shader
->
mLightHash
!=
mLightHash
)
{
shader
->
mLightHash
=
mLightHash
;
LLVector4
position
[
8
];
LLVector3
direction
[
8
];
LLVector4
attenuation
[
8
];
LLVector3
diffuse
[
8
];
LLVector3
diffuse_b
[
8
];
bool
sun_primary
[
8
];
LLVector4
position
[
LL_NUM_LIGHT_UNITS
];
LLVector3
direction
[
LL_NUM_LIGHT_UNITS
];
LLVector4
attenuation
[
LL_NUM_LIGHT_UNITS
];
LLVector3
diffuse
[
LL_NUM_LIGHT_UNITS
];
LLVector3
diffuse_b
[
LL_NUM_LIGHT_UNITS
];
bool
sun_primary
[
LL_NUM_LIGHT_UNITS
];
for
(
U32
i
=
0
;
i
<
8
;
i
++
)
{
LLLightState
*
light
=
mLightState
[
i
];
for
(
U32
i
=
0
;
i
<
LL_NUM_LIGHT_UNITS
;
i
++
)
{
LLLightState
*
light
=
mLightState
[
i
];
position
[
i
]
=
light
->
mPosition
;
direction
[
i
]
=
light
->
mSpotDirection
;
position
[
i
]
=
light
->
mPosition
;
direction
[
i
]
=
light
->
mSpotDirection
;
attenuation
[
i
].
set
(
light
->
mLinearAtten
,
light
->
mQuadraticAtten
,
light
->
mSpecular
.
mV
[
2
],
light
->
mSpecular
.
mV
[
3
]);
diffuse
[
i
].
set
(
light
->
mDiffuse
.
mV
);
diffuse
[
i
].
set
(
light
->
mDiffuse
.
mV
);
diffuse_b
[
i
].
set
(
light
->
mDiffuseB
.
mV
);
sun_primary
[
i
]
=
light
->
mSunIsPrimary
;
}
}
shader
->
uniform4fv
(
LLShaderMgr
::
LIGHT_POSITION
,
8
,
position
[
0
].
mV
);
shader
->
uniform3fv
(
LLShaderMgr
::
LIGHT_DIRECTION
,
8
,
direction
[
0
].
mV
);
shader
->
uniform4fv
(
LLShaderMgr
::
LIGHT_ATTENUATION
,
8
,
attenuation
[
0
].
mV
);
shader
->
uniform3fv
(
LLShaderMgr
::
LIGHT_DIFFUSE
,
8
,
diffuse
[
0
].
mV
);
shader
->
uniform4fv
(
LLShaderMgr
::
LIGHT_AMBIENT
,
1
,
mAmbientLightColor
.
mV
);
shader
->
uniform4fv
(
LLShaderMgr
::
LIGHT_POSITION
,
LL_NUM_LIGHT_UNITS
,
position
[
0
].
mV
);
shader
->
uniform3fv
(
LLShaderMgr
::
LIGHT_DIRECTION
,
LL_NUM_LIGHT_UNITS
,
direction
[
0
].
mV
);
shader
->
uniform4fv
(
LLShaderMgr
::
LIGHT_ATTENUATION
,
LL_NUM_LIGHT_UNITS
,
attenuation
[
0
].
mV
);
shader
->
uniform3fv
(
LLShaderMgr
::
LIGHT_DIFFUSE
,
LL_NUM_LIGHT_UNITS
,
diffuse
[
0
].
mV
);
shader
->
uniform4fv
(
LLShaderMgr
::
LIGHT_AMBIENT
,
1
,
mAmbientLightColor
.
mV
);
shader
->
uniform1i
(
LLShaderMgr
::
SUN_UP_FACTOR
,
sun_primary
[
0
]
?
1
:
0
);
shader
->
uniform4fv
(
LLShaderMgr
::
AMBIENT
,
1
,
mAmbientLightColor
.
mV
);
shader
->
uniform4fv
(
LLShaderMgr
::
SUNLIGHT_COLOR
,
1
,
diffuse
[
0
].
mV
);
shader
->
uniform4fv
(
LLShaderMgr
::
MOONLIGHT_COLOR
,
1
,
diffuse_b
[
0
].
mV
);
}
}
}
void
LLRender
::
syncMatrices
()
...
...
@@ -1539,11 +1545,17 @@ void LLRender::matrixMode(eMatrixMode mode)
{
U32
tex_index
=
gGL
.
getCurrentTexUnitIndex
();
// the shaders don't actually reference anything beyond texture_matrix0/1 outside of terrain rendering
llassert_always
(
tex_index
<=
3
);
mode
=
eMatrixMode
(
MM_TEXTURE0
+
gGL
.
getCurrentTexUnitIndex
());
llassert
(
tex_index
<=
3
);
mode
=
eMatrixMode
(
MM_TEXTURE0
+
tex_index
);
if
(
mode
>
MM_TEXTURE3
)
{
// getCurrentTexUnitIndex() can go as high as 32 (LL_NUM_TEXTURE_LAYERS)
// Large value will result in a crash at mMatrix
LL_WARNS_ONCE
()
<<
"Attempted to assign matrix mode out of bounds: "
<<
mode
<<
LL_ENDL
;
mode
=
MM_TEXTURE0
;
}
}
llassert
(
mode
<
NUM_MATRIX_MODES
);
mMatrixMode
=
mode
;
}
...
...
indra/llrender/llrendertarget.cpp
View file @
663a6dc2
...
...
@@ -501,23 +501,23 @@ U32 LLRenderTarget::getNumTextures() const
return
mTex
.
size
();
}
void
LLRenderTarget
::
bindTexture
(
U32
index
,
S32
channel
,
LLTexUnit
::
eTextureFilterOptions
filter_options
)
{
gGL
.
getTexUnit
(
channel
)
->
bindManual
(
mUsage
,
getTexture
(
index
));
gGL
.
getTexUnit
(
channel
)
->
bindManual
(
mUsage
,
getTexture
(
index
));
bool
isSRGB
=
false
;
llassert
(
mInternalFormat
.
size
()
>
index
);
switch
(
mInternalFormat
[
index
])
{
case
GL_SRGB_ALPHA
:
case
GL_SRGB
:
case
GL_SRGB8
:
case
GL_SRGB_ALPHA
:
case
GL_SRGB8_ALPHA8
:
isSRGB
=
true
;
break
;
break
;
default:
break
;
break
;
}
gGL
.
getTexUnit
(
channel
)
->
setTextureFilteringOption
(
filter_options
);
...
...
indra/llrender/llshadermgr.cpp
View file @
663a6dc2
...
...
@@ -1180,7 +1180,7 @@ void LLShaderMgr::initAttribsAndUniforms()
llassert
(
mReservedUniforms
.
size
()
==
LLShaderMgr
::
MULTI_LIGHT_FAR_Z
+
1
);
//NOTE: MUST match order in eGLSLReservedUniforms
mReservedUniforms
.
push_back
(
"proj_mat"
);
mReservedUniforms
.
push_back
(
"proj_near"
);
mReservedUniforms
.
push_back
(
"proj_p"
);
...
...
indra/newview/VIEWER_VERSION.txt
View file @
663a6dc2
6.4.
9
6.4.
10
indra/newview/app_settings/settings.xml
View file @
663a6dc2
...
...
@@ -812,17 +812,6 @@
<key>
Value
</key>
<integer>
0
</integer>
</map>
<key>
FramePerSecondLimit
</key>
<map>
<key>
Comment
</key>
<string>
Controls upper limit of frames per second
</string>
<key>
Persist
</key>
<integer>
1
</integer>
<key>
Type
</key>
<string>
U32
</string>
<key>
Value
</key>
<integer>
120
</integer>
</map>
<key>
BackgroundYieldTime
</key>
<map>
<key>
Comment
</key>
...
...
indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
View file @
663a6dc2
/**
/**
* @file WLCloudsV.glsl
*
* $LicenseInfo:firstyear=2005&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2005, Linden Research, Inc.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
...
...
@@ -33,26 +33,26 @@ ATTRIBUTE vec2 texcoord0;
///////////////////////////////////////////////////////////////////////////////
// Output parameters
VARYING
vec4
vary_CloudColorSun
;
VARYING
vec4
vary_CloudColorAmbient
;
VARYING
vec4
vary_CloudColorSun
;
VARYING
vec4
vary_CloudColorAmbient
;
VARYING
float
vary_CloudDensity
;
VARYING
vec2
vary_texcoord0
;
VARYING
vec2
vary_texcoord1
;
VARYING
vec2
vary_texcoord2
;
VARYING
vec2
vary_texcoord3
;
VARYING
vec2
vary_texcoord0
;
VARYING
vec2
vary_texcoord1
;
VARYING
vec2
vary_texcoord2
;
VARYING
vec2
vary_texcoord3
;
VARYING
float
altitude_blend_factor
;
// Inputs
uniform
vec3
camPosLocal
;
uniform
vec4
lightnorm
;
uniform
vec4
sunlight_color
;
uniform
vec4
moonlight_color
;
uniform
int
sun_up_factor
;
uniform
vec4
ambient_color
;
uniform
vec4
blue_horizon
;
uniform
vec4
blue_density
;
uniform
vec4
lightnorm
;
uniform
vec4
sunlight_color
;
uniform
vec4
moonlight_color
;
uniform
int
sun_up_factor
;
uniform
vec4
ambient_color
;
uniform
vec4
blue_horizon
;
uniform
vec4
blue_density
;
uniform
float
haze_horizon
;
uniform
float
haze_density
;
...
...
@@ -60,7 +60,7 @@ uniform float cloud_shadow;
uniform
float
density_multiplier
;
uniform
float
max_y
;
uniform
vec4
glow
;
uniform
vec4
glow
;
uniform
float
sun_moon_glow_factor
;
uniform
vec4
cloud_color
;
...
...
@@ -70,133 +70,123 @@ uniform float cloud_scale;
// NOTE: Keep these in sync!
// indra\newview\app_settings\shaders\class1\deferred\skyV.glsl
// indra\newview\app_settings\shaders\class1\deferred\cloudsV.glsl
// indra\newview\app-settings\shaders\class2\windlight\cloudsV.glsl
// indra\newview\lllegacyatmospherics.cpp
// indra\newview\llsettingsvo.cpp
void
main
()
{
// World / view / projection
gl_Position
=
modelview_projection_matrix
*
vec4
(
position
.
xyz
,
1
.
0
);
// Texture coords
vary_texcoord0
=
texcoord0
;
vary_texcoord0
.
xy
-=
0
.
5
;
vary_texcoord0
.
xy
/=
cloud_scale
;
vary_texcoord0
.
xy
+=
0
.
5
;
vary_texcoord1
=
vary_texcoord0
;
vary_texcoord1
.
x
+=
lightnorm
.
x
*
0
.
0125
;
vary_texcoord1
.
y
+=
lightnorm
.
z
*
0
.
0125
;
vary_texcoord2
=
vary_texcoord0
*
16
.;
vary_texcoord3
=
vary_texcoord1
*
16
.;
// Get relative position
vec3
P
=
position
.
xyz
-
camPosLocal
.
xyz
+
vec3
(
0
,
50
,
0
);
altitude_blend_factor
=
clamp
((
P
.
y
+
512
.
0
)
/
max_y
,
0
.
0
,
1
.
0
);
// Set altitude
if
(
P
.
y
>
0
.)
{
P
*=
(
max_y
/
P
.
y
);
}
else
{
altitude_blend_factor
=
0
;
// SL-11589 Fix clouds drooping below horizon
P
*=
(
-
32000
.
/
P
.
y
);
}
// Can normalize then
vec3
Pn
=
normalize
(
P
);
float
Plen
=
length
(
P
);
// Initialize temp variables
vec4
temp1
=
vec4
(
0
.);
vec4
temp2
=
vec4
(
0
.);
vec4
blue_weight
;
vec4
haze_weight
;
//vec4 sunlight = (sun_up_factor == 1) ? sunlight_color : moonlight_color;
vec4
sunlight
=
sunlight_color
;
vec4
light_atten
;
float
dens_mul
=
density_multiplier
;
// Sunlight attenuation effect (hue and brightness) due to atmosphere
// this is used later for sunlight modulation at various altitudes
light_atten
=
(
blue_density
+
vec4
(
haze_density
*
0
.
25
))
*
(
dens_mul
*
max_y
);
// Calculate relative weights
temp1
=
abs
(
blue_density
)
+
vec4
(
abs
(
haze_density
));
blue_weight
=
blue_density
/
temp1
;
haze_weight
=
haze_density
/
temp1
;
// Compute sunlight from P & lightnorm (for long rays like sky)
temp2
.
y
=
max
(
0
.,
max
(
0
.,
Pn
.
y
)
*
1
.
0
+
lightnorm
.
y
);
temp2
.
y
=
1
.
/
temp2
.
y
;
sunlight
*=
exp
(
-
light_atten
*
temp2
.
y
);
// Distance
temp2
.
z
=
Plen
*
dens_mul
;
// Transparency (-> temp1)
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
// compiler gets confused.
temp1
=
exp
(
-
temp1
*
temp2
.
z
);
// Compute haze glow
temp2
.
x
=
dot
(
Pn
,
lightnorm
.
xyz
);
temp2
.
x
=
1
.
-
temp2
.
x
;
// temp2.x is 0 at the sun and increases away from sun
temp2
.
x
=
max
(
temp2
.
x
,
.
001
);
// Set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot)
temp2
.
x
*=
glow
.
x
;
// Higher glow.x gives dimmer glow (because next step is 1 / "angle")
temp2
.
x
=
pow
(
temp2
.
x
,
glow
.
z
);
// glow.z should be negative, so we're doing a sort of (1 / "angle") function
temp2
.
x
*=
sun_moon_glow_factor
;
// Add "minimum anti-solar illumination"
temp2
.
x
+=
.
25
;
// Increase ambient when there are more clouds
vec4
tmpAmbient
=
ambient_color
;
tmpAmbient
+=
(
1
.
-
tmpAmbient
)
*
cloud_shadow
*
0
.
5
;
// Dim sunlight by cloud shadow percentage
sunlight
*=
(
1
.
-
cloud_shadow
);
// Haze color below cloud
vec4
additiveColorBelowCloud
=
(
blue_horizon
*
blue_weight
*
(
sunlight
+
tmpAmbient
)
+
(
haze_horizon
*
haze_weight
)
*
(
sunlight
*
temp2
.
x
+
tmpAmbient
)
);
// CLOUDS
temp2
.
y
=
max
(
0
.,
lightnorm
.
y
*
2
.);
temp2
.
y
=
1
.
/
temp2
.
y
;
sunlight
*=
exp
(
-
light_atten
*
temp2
.
y
);