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
43eda06e
Commit
43eda06e
authored
4 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Clean up pointless function parameters from WL draw pool
parent
e33190a9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/newview/lldrawpoolwlsky.cpp
+63
-66
63 additions, 66 deletions
indra/newview/lldrawpoolwlsky.cpp
indra/newview/lldrawpoolwlsky.h
+11
-7
11 additions, 7 deletions
indra/newview/lldrawpoolwlsky.h
with
74 additions
and
73 deletions
indra/newview/lldrawpoolwlsky.cpp
+
63
−
66
View file @
43eda06e
...
@@ -94,6 +94,11 @@ void LLDrawPoolWLSky::beginRenderPass( S32 pass )
...
@@ -94,6 +94,11 @@ void LLDrawPoolWLSky::beginRenderPass( S32 pass )
LLPipeline
::
sUnderWaterRender
?
LLPipeline
::
sUnderWaterRender
?
&
gObjectFullbrightNoColorWaterProgram
:
&
gObjectFullbrightNoColorWaterProgram
:
&
gCustomAlphaProgram
;
&
gCustomAlphaProgram
;
auto
&
environment
=
LLEnvironment
::
instance
();
mCamHeightLocal
=
environment
.
getCamHeight
();
mCameraOrigin
=
LLViewerCamera
::
getInstance
()
->
getOrigin
();
mCurrentSky
=
environment
.
getCurrentSky
();
}
}
void
LLDrawPoolWLSky
::
endRenderPass
(
S32
pass
)
void
LLDrawPoolWLSky
::
endRenderPass
(
S32
pass
)
...
@@ -103,6 +108,7 @@ void LLDrawPoolWLSky::endRenderPass( S32 pass )
...
@@ -103,6 +108,7 @@ void LLDrawPoolWLSky::endRenderPass( S32 pass )
sun_shader
=
nullptr
;
sun_shader
=
nullptr
;
moon_shader
=
nullptr
;
moon_shader
=
nullptr
;
star_shader
=
nullptr
;
star_shader
=
nullptr
;
mCurrentSky
=
nullptr
;
}
}
void
LLDrawPoolWLSky
::
beginDeferredPass
(
S32
pass
)
void
LLDrawPoolWLSky
::
beginDeferredPass
(
S32
pass
)
...
@@ -124,6 +130,11 @@ void LLDrawPoolWLSky::beginDeferredPass(S32 pass)
...
@@ -124,6 +130,11 @@ void LLDrawPoolWLSky::beginDeferredPass(S32 pass)
LLPipeline
::
sUnderWaterRender
?
LLPipeline
::
sUnderWaterRender
?
&
gObjectFullbrightNoColorWaterProgram
:
&
gObjectFullbrightNoColorWaterProgram
:
&
gDeferredStarProgram
;
&
gDeferredStarProgram
;
auto
&
environment
=
LLEnvironment
::
instance
();
mCamHeightLocal
=
environment
.
getCamHeight
();
mCameraOrigin
=
LLViewerCamera
::
getInstance
()
->
getOrigin
();
mCurrentSky
=
environment
.
getCurrentSky
();
}
}
void
LLDrawPoolWLSky
::
endDeferredPass
(
S32
pass
)
void
LLDrawPoolWLSky
::
endDeferredPass
(
S32
pass
)
...
@@ -133,9 +144,10 @@ void LLDrawPoolWLSky::endDeferredPass(S32 pass)
...
@@ -133,9 +144,10 @@ void LLDrawPoolWLSky::endDeferredPass(S32 pass)
sun_shader
=
nullptr
;
sun_shader
=
nullptr
;
moon_shader
=
nullptr
;
moon_shader
=
nullptr
;
star_shader
=
nullptr
;
star_shader
=
nullptr
;
mCurrentSky
=
nullptr
;
}
}
void
LLDrawPoolWLSky
::
renderDome
(
const
LLVector3
&
camPosLocal
,
F32
camHeightLocal
,
LLGLSLShader
*
shader
)
const
void
LLDrawPoolWLSky
::
renderDome
(
LLGLSLShader
*
shader
)
const
{
{
llassert_always
(
NULL
!=
shader
);
llassert_always
(
NULL
!=
shader
);
...
@@ -143,13 +155,13 @@ void LLDrawPoolWLSky::renderDome(const LLVector3& camPosLocal, F32 camHeightLoca
...
@@ -143,13 +155,13 @@ void LLDrawPoolWLSky::renderDome(const LLVector3& camPosLocal, F32 camHeightLoca
gGL
.
pushMatrix
();
gGL
.
pushMatrix
();
//chop off translation
//chop off translation
if
(
LLPipeline
::
sReflectionRender
&&
camPosLocal
.
mV
[
2
]
>
256.
f
)
if
(
LLPipeline
::
sReflectionRender
&&
mCameraOrigin
.
mV
[
2
]
>
256.
f
)
{
{
gGL
.
translatef
(
camPosLocal
.
mV
[
0
],
camPosLocal
.
mV
[
1
],
256.
f
-
camPosLocal
.
mV
[
2
]
*
0.5
f
);
gGL
.
translatef
(
mCameraOrigin
.
mV
[
0
],
mCameraOrigin
.
mV
[
1
],
256.
f
-
mCameraOrigin
.
mV
[
2
]
*
0.5
f
);
}
}
else
else
{
{
gGL
.
translatef
(
camPosLocal
.
mV
[
0
],
camPosLocal
.
mV
[
1
],
camPosLocal
.
mV
[
2
]);
gGL
.
translatef
(
mCameraOrigin
.
mV
[
0
],
mCameraOrigin
.
mV
[
1
],
mCameraOrigin
.
mV
[
2
]);
}
}
...
@@ -159,10 +171,10 @@ void LLDrawPoolWLSky::renderDome(const LLVector3& camPosLocal, F32 camHeightLoca
...
@@ -159,10 +171,10 @@ void LLDrawPoolWLSky::renderDome(const LLVector3& camPosLocal, F32 camHeightLoca
gGL
.
scalef
(
0.333
f
,
0.333
f
,
0.333
f
);
gGL
.
scalef
(
0.333
f
,
0.333
f
,
0.333
f
);
gGL
.
translatef
(
0.
f
,
-
c
amHeightLocal
,
0.
f
);
gGL
.
translatef
(
0.
f
,
-
mC
amHeightLocal
,
0.
f
);
// Draw WL Sky
// Draw WL Sky
shader
->
uniform3f
(
sCamPosLocal
,
0.
f
,
c
amHeightLocal
,
0.
f
);
shader
->
uniform3f
(
sCamPosLocal
,
0.
f
,
mC
amHeightLocal
,
0.
f
);
gSky
.
mVOWLSkyp
->
drawDome
();
gSky
.
mVOWLSkyp
->
drawDome
();
...
@@ -170,7 +182,7 @@ void LLDrawPoolWLSky::renderDome(const LLVector3& camPosLocal, F32 camHeightLoca
...
@@ -170,7 +182,7 @@ void LLDrawPoolWLSky::renderDome(const LLVector3& camPosLocal, F32 camHeightLoca
gGL
.
popMatrix
();
gGL
.
popMatrix
();
}
}
void
LLDrawPoolWLSky
::
renderSkyHazeDeferred
(
const
LLSettingsSky
::
ptr_t
&
psky
,
const
LLVector3
&
camPosLocal
,
F32
camHeightLocal
)
const
void
LLDrawPoolWLSky
::
renderSkyHazeDeferred
()
const
{
{
if
(
gPipeline
.
canUseWindLightShaders
()
&&
gPipeline
.
hasRenderType
(
LLPipeline
::
RENDER_TYPE_SKY
))
if
(
gPipeline
.
canUseWindLightShaders
()
&&
gPipeline
.
hasRenderType
(
LLPipeline
::
RENDER_TYPE_SKY
))
{
{
...
@@ -184,14 +196,14 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLSettingsSky::ptr_t& psky, co
...
@@ -184,14 +196,14 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLSettingsSky::ptr_t& psky, co
sky_shader
->
bindTexture
(
LLShaderMgr
::
RAINBOW_MAP
,
rainbow_tex
);
sky_shader
->
bindTexture
(
LLShaderMgr
::
RAINBOW_MAP
,
rainbow_tex
);
sky_shader
->
bindTexture
(
LLShaderMgr
::
HALO_MAP
,
halo_tex
);
sky_shader
->
bindTexture
(
LLShaderMgr
::
HALO_MAP
,
halo_tex
);
((
LLSettingsVOSky
*
)
ps
ky
.
get
())
->
updateShader
(
sky_shader
);
((
LLSettingsVOSky
*
)
mCurrentS
ky
.
get
())
->
updateShader
(
sky_shader
);
F32
moisture_level
=
(
float
)
ps
ky
->
getSkyMoistureLevel
();
F32
moisture_level
=
(
float
)
mCurrentS
ky
->
getSkyMoistureLevel
();
F32
droplet_radius
=
(
float
)
ps
ky
->
getSkyDropletRadius
();
F32
droplet_radius
=
(
float
)
mCurrentS
ky
->
getSkyDropletRadius
();
F32
ice_level
=
(
float
)
ps
ky
->
getSkyIceLevel
();
F32
ice_level
=
(
float
)
mCurrentS
ky
->
getSkyIceLevel
();
// hobble halos and rainbows when there's no light source to generate them
// hobble halos and rainbows when there's no light source to generate them
if
(
!
ps
ky
->
getIsSunUp
()
&&
!
ps
ky
->
getIsMoonUp
())
if
(
!
mCurrentS
ky
->
getIsSunUp
()
&&
!
mCurrentS
ky
->
getIsMoonUp
())
{
{
moisture_level
=
0.0
f
;
moisture_level
=
0.0
f
;
ice_level
=
0.0
f
;
ice_level
=
0.0
f
;
...
@@ -201,18 +213,18 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLSettingsSky::ptr_t& psky, co
...
@@ -201,18 +213,18 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLSettingsSky::ptr_t& psky, co
sky_shader
->
uniform1f
(
LLShaderMgr
::
DROPLET_RADIUS
,
droplet_radius
);
sky_shader
->
uniform1f
(
LLShaderMgr
::
DROPLET_RADIUS
,
droplet_radius
);
sky_shader
->
uniform1f
(
LLShaderMgr
::
ICE_LEVEL
,
ice_level
);
sky_shader
->
uniform1f
(
LLShaderMgr
::
ICE_LEVEL
,
ice_level
);
sky_shader
->
uniform1f
(
LLShaderMgr
::
SUN_MOON_GLOW_FACTOR
,
ps
ky
->
getSunMoonGlowFactor
());
sky_shader
->
uniform1f
(
LLShaderMgr
::
SUN_MOON_GLOW_FACTOR
,
mCurrentS
ky
->
getSunMoonGlowFactor
());
sky_shader
->
uniform1i
(
LLShaderMgr
::
SUN_UP_FACTOR
,
ps
ky
->
getIsSunUp
()
?
1
:
0
);
sky_shader
->
uniform1i
(
LLShaderMgr
::
SUN_UP_FACTOR
,
mCurrentS
ky
->
getIsSunUp
()
?
1
:
0
);
/// Render the skydome
/// Render the skydome
renderDome
(
camPosLocal
,
camHeightLocal
,
sky_shader
);
renderDome
(
sky_shader
);
sky_shader
->
unbind
();
sky_shader
->
unbind
();
}
}
}
}
void
LLDrawPoolWLSky
::
renderSkyHaze
(
const
LLVector3
&
camPosLocal
,
F32
camHeightLocal
)
const
void
LLDrawPoolWLSky
::
renderSkyHaze
()
const
{
{
if
(
gPipeline
.
canUseWindLightShaders
()
&&
gPipeline
.
hasRenderType
(
LLPipeline
::
RENDER_TYPE_SKY
))
if
(
gPipeline
.
canUseWindLightShaders
()
&&
gPipeline
.
hasRenderType
(
LLPipeline
::
RENDER_TYPE_SKY
))
{
{
...
@@ -221,12 +233,12 @@ void LLDrawPoolWLSky::renderSkyHaze(const LLVector3& camPosLocal, F32 camHeightL
...
@@ -221,12 +233,12 @@ void LLDrawPoolWLSky::renderSkyHaze(const LLVector3& camPosLocal, F32 camHeightL
sky_shader
->
bind
();
sky_shader
->
bind
();
sky_shader
->
uniform1i
(
LLShaderMgr
::
SUN_UP_FACTOR
,
1
);
sky_shader
->
uniform1i
(
LLShaderMgr
::
SUN_UP_FACTOR
,
1
);
sky_shader
->
uniform1f
(
LLShaderMgr
::
SUN_MOON_GLOW_FACTOR
,
psky
->
getSunMoonGlowFactor
());
sky_shader
->
uniform1f
(
LLShaderMgr
::
SUN_MOON_GLOW_FACTOR
,
psky
->
getSunMoonGlowFactor
());
renderDome
(
camPosLocal
,
camHeightLocal
,
sky_shader
);
renderDome
(
sky_shader
);
sky_shader
->
unbind
();
sky_shader
->
unbind
();
}
}
}
}
void
LLDrawPoolWLSky
::
renderStars
(
const
LLSettingsSky
::
ptr_t
&
psky
,
const
LLVector3
&
camPosLocal
)
const
void
LLDrawPoolWLSky
::
renderStars
()
const
{
{
LLGLSPipelineBlendSkyBox
gls_skybox
(
true
,
false
);
LLGLSPipelineBlendSkyBox
gls_skybox
(
true
,
false
);
...
@@ -239,7 +251,7 @@ void LLDrawPoolWLSky::renderStars(const LLSettingsSky::ptr_t& psky, const LLVect
...
@@ -239,7 +251,7 @@ void LLDrawPoolWLSky::renderStars(const LLSettingsSky::ptr_t& psky, const LLVect
// clamping and allow the star_alpha param to brighten the stars.
// clamping and allow the star_alpha param to brighten the stars.
LLColor4
star_alpha
(
LLColor4
::
black
);
LLColor4
star_alpha
(
LLColor4
::
black
);
star_alpha
.
mV
[
3
]
=
ps
ky
->
getStarBrightness
()
/
512.
f
;
star_alpha
.
mV
[
3
]
=
mCurrentS
ky
->
getStarBrightness
()
/
512.
f
;
// If star brightness is not set, exit
// If star brightness is not set, exit
if
(
star_alpha
.
mV
[
3
]
<
0.001
)
if
(
star_alpha
.
mV
[
3
]
<
0.001
)
...
@@ -268,7 +280,7 @@ void LLDrawPoolWLSky::renderStars(const LLSettingsSky::ptr_t& psky, const LLVect
...
@@ -268,7 +280,7 @@ void LLDrawPoolWLSky::renderStars(const LLSettingsSky::ptr_t& psky, const LLVect
}
}
gGL
.
pushMatrix
();
gGL
.
pushMatrix
();
gGL
.
translatef
(
camPosLocal
.
mV
[
0
],
camPosLocal
.
mV
[
1
],
camPosLocal
.
mV
[
2
]);
gGL
.
translatef
(
mCameraOrigin
.
mV
[
0
],
mCameraOrigin
.
mV
[
1
],
mCameraOrigin
.
mV
[
2
]);
if
(
LLGLSLShader
::
sNoFixedFunction
)
if
(
LLGLSLShader
::
sNoFixedFunction
)
{
{
star_shader
->
bind
();
star_shader
->
bind
();
...
@@ -298,13 +310,13 @@ void LLDrawPoolWLSky::renderStars(const LLSettingsSky::ptr_t& psky, const LLVect
...
@@ -298,13 +310,13 @@ void LLDrawPoolWLSky::renderStars(const LLSettingsSky::ptr_t& psky, const LLVect
}
}
}
}
void
LLDrawPoolWLSky
::
renderStarsDeferred
(
const
LLSettingsSky
::
ptr_t
&
psky
,
const
LLVector3
&
camPosLocal
)
const
void
LLDrawPoolWLSky
::
renderStarsDeferred
()
const
{
{
LLGLSPipelineBlendSkyBox
gls_sky
(
true
,
false
);
LLGLSPipelineBlendSkyBox
gls_sky
(
true
,
false
);
gGL
.
setSceneBlendType
(
LLRender
::
BT_ADD_WITH_ALPHA
);
gGL
.
setSceneBlendType
(
LLRender
::
BT_ADD_WITH_ALPHA
);
F32
star_alpha
=
ps
ky
->
getStarBrightness
()
/
500.0
f
;
F32
star_alpha
=
mCurrentS
ky
->
getStarBrightness
()
/
500.0
f
;
// If start_brightness is not set, exit
// If start_brightness is not set, exit
if
(
star_alpha
<
0.001
f
)
if
(
star_alpha
<
0.001
f
)
...
@@ -318,7 +330,7 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky, cons
...
@@ -318,7 +330,7 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky, cons
LLViewerTexture
*
tex_a
=
gSky
.
mVOSkyp
->
getBloomTex
();
LLViewerTexture
*
tex_a
=
gSky
.
mVOSkyp
->
getBloomTex
();
LLViewerTexture
*
tex_b
=
gSky
.
mVOSkyp
->
getBloomTexNext
();
LLViewerTexture
*
tex_b
=
gSky
.
mVOSkyp
->
getBloomTexNext
();
F32
blend_factor
=
ps
ky
->
getBlendFactor
();
F32
blend_factor
=
mCurrentS
ky
->
getBlendFactor
();
if
(
tex_a
&&
(
!
tex_b
||
(
tex_a
==
tex_b
)))
if
(
tex_a
&&
(
!
tex_b
||
(
tex_a
==
tex_b
)))
{
{
...
@@ -340,7 +352,7 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky, cons
...
@@ -340,7 +352,7 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky, cons
}
}
gGL
.
pushMatrix
();
gGL
.
pushMatrix
();
gGL
.
translatef
(
camPosLocal
.
mV
[
0
],
camPosLocal
.
mV
[
1
],
camPosLocal
.
mV
[
2
]);
gGL
.
translatef
(
mCameraOrigin
.
mV
[
0
],
mCameraOrigin
.
mV
[
1
],
mCameraOrigin
.
mV
[
2
]);
star_shader
->
bind
();
star_shader
->
bind
();
...
@@ -364,13 +376,13 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky, cons
...
@@ -364,13 +376,13 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky, cons
star_shader
->
unbind
();
star_shader
->
unbind
();
}
}
void
LLDrawPoolWLSky
::
renderSkyClouds
(
const
LLSettingsSky
::
ptr_t
&
psky
,
const
LLVector3
&
camPosLocal
,
F32
camHeightLocal
,
LLGLSLShader
*
cloudshader
)
const
void
LLDrawPoolWLSky
::
renderSkyClouds
()
const
{
{
if
(
gPipeline
.
canUseWindLightShaders
()
&&
gPipeline
.
hasRenderType
(
LLPipeline
::
RENDER_TYPE_CLOUDS
)
&&
gSky
.
mVOSkyp
->
getCloudNoiseTex
())
if
(
gPipeline
.
canUseWindLightShaders
()
&&
gPipeline
.
hasRenderType
(
LLPipeline
::
RENDER_TYPE_CLOUDS
)
&&
gSky
.
mVOSkyp
->
getCloudNoiseTex
())
{
{
LLGLSPipelineBlendSkyBox
pipeline
(
true
,
true
);
LLGLSPipelineBlendSkyBox
pipeline
(
true
,
true
);
cloudshader
->
bind
();
cloud
_
shader
->
bind
();
LLPointer
<
LLViewerTexture
>
cloud_noise
=
gSky
.
mVOSkyp
->
getCloudNoiseTex
();
LLPointer
<
LLViewerTexture
>
cloud_noise
=
gSky
.
mVOSkyp
->
getCloudNoiseTex
();
LLPointer
<
LLViewerTexture
>
cloud_noise_next
=
gSky
.
mVOSkyp
->
getCloudNoiseTexNext
();
LLPointer
<
LLViewerTexture
>
cloud_noise_next
=
gSky
.
mVOSkyp
->
getCloudNoiseTexNext
();
...
@@ -378,8 +390,8 @@ void LLDrawPoolWLSky::renderSkyClouds(const LLSettingsSky::ptr_t& psky, const LL
...
@@ -378,8 +390,8 @@ void LLDrawPoolWLSky::renderSkyClouds(const LLSettingsSky::ptr_t& psky, const LL
gGL
.
getTexUnit
(
0
)
->
unbind
(
LLTexUnit
::
TT_TEXTURE
);
gGL
.
getTexUnit
(
0
)
->
unbind
(
LLTexUnit
::
TT_TEXTURE
);
gGL
.
getTexUnit
(
1
)
->
unbind
(
LLTexUnit
::
TT_TEXTURE
);
gGL
.
getTexUnit
(
1
)
->
unbind
(
LLTexUnit
::
TT_TEXTURE
);
F32
cloud_variance
=
psky
?
ps
ky
->
getCloudVariance
()
:
0.0
f
;
F32
cloud_variance
=
mCurrentSky
?
mCurrentS
ky
->
getCloudVariance
()
:
0.0
f
;
F32
blend_factor
=
psky
?
ps
ky
->
getBlendFactor
()
:
0.0
f
;
F32
blend_factor
=
mCurrentSky
?
mCurrentS
ky
->
getBlendFactor
()
:
0.0
f
;
// if we even have sun disc textures to work with...
// if we even have sun disc textures to work with...
if
(
cloud_noise
||
cloud_noise_next
)
if
(
cloud_noise
||
cloud_noise_next
)
...
@@ -387,47 +399,47 @@ void LLDrawPoolWLSky::renderSkyClouds(const LLSettingsSky::ptr_t& psky, const LL
...
@@ -387,47 +399,47 @@ void LLDrawPoolWLSky::renderSkyClouds(const LLSettingsSky::ptr_t& psky, const LL
if
(
cloud_noise
&&
(
!
cloud_noise_next
||
(
cloud_noise
==
cloud_noise_next
)))
if
(
cloud_noise
&&
(
!
cloud_noise_next
||
(
cloud_noise
==
cloud_noise_next
)))
{
{
// Bind current and next sun textures
// Bind current and next sun textures
cloudshader
->
bindTexture
(
LLShaderMgr
::
CLOUD_NOISE_MAP
,
cloud_noise
,
LLTexUnit
::
TT_TEXTURE
);
cloud
_
shader
->
bindTexture
(
LLShaderMgr
::
CLOUD_NOISE_MAP
,
cloud_noise
,
LLTexUnit
::
TT_TEXTURE
);
blend_factor
=
0
;
blend_factor
=
0
;
}
}
else
if
(
cloud_noise_next
&&
!
cloud_noise
)
else
if
(
cloud_noise_next
&&
!
cloud_noise
)
{
{
cloudshader
->
bindTexture
(
LLShaderMgr
::
CLOUD_NOISE_MAP
,
cloud_noise_next
,
LLTexUnit
::
TT_TEXTURE
);
cloud
_
shader
->
bindTexture
(
LLShaderMgr
::
CLOUD_NOISE_MAP
,
cloud_noise_next
,
LLTexUnit
::
TT_TEXTURE
);
blend_factor
=
0
;
blend_factor
=
0
;
}
}
else
if
(
cloud_noise_next
!=
cloud_noise
)
else
if
(
cloud_noise_next
!=
cloud_noise
)
{
{
cloudshader
->
bindTexture
(
LLShaderMgr
::
CLOUD_NOISE_MAP
,
cloud_noise
,
LLTexUnit
::
TT_TEXTURE
);
cloud
_
shader
->
bindTexture
(
LLShaderMgr
::
CLOUD_NOISE_MAP
,
cloud_noise
,
LLTexUnit
::
TT_TEXTURE
);
cloudshader
->
bindTexture
(
LLShaderMgr
::
CLOUD_NOISE_MAP_NEXT
,
cloud_noise_next
,
LLTexUnit
::
TT_TEXTURE
);
cloud
_
shader
->
bindTexture
(
LLShaderMgr
::
CLOUD_NOISE_MAP_NEXT
,
cloud_noise_next
,
LLTexUnit
::
TT_TEXTURE
);
}
}
}
}
cloudshader
->
uniform1f
(
LLShaderMgr
::
BLEND_FACTOR
,
blend_factor
);
cloud
_
shader
->
uniform1f
(
LLShaderMgr
::
BLEND_FACTOR
,
blend_factor
);
cloudshader
->
uniform1f
(
LLShaderMgr
::
CLOUD_VARIANCE
,
cloud_variance
);
cloud
_
shader
->
uniform1f
(
LLShaderMgr
::
CLOUD_VARIANCE
,
cloud_variance
);
cloudshader
->
uniform1f
(
LLShaderMgr
::
SUN_MOON_GLOW_FACTOR
,
ps
ky
->
getSunMoonGlowFactor
());
cloud
_
shader
->
uniform1f
(
LLShaderMgr
::
SUN_MOON_GLOW_FACTOR
,
mCurrentS
ky
->
getSunMoonGlowFactor
());
((
LLSettingsVOSky
*
)
ps
ky
.
get
())
->
updateShader
(
cloudshader
);
((
LLSettingsVOSky
*
)
mCurrentS
ky
.
get
())
->
updateShader
(
cloud
_
shader
);
/// Render the skydome
/// Render the skydome
renderDome
(
camPosLocal
,
camHeightLocal
,
cloudshader
);
renderDome
(
cloud
_
shader
);
cloudshader
->
unbind
();
cloud
_
shader
->
unbind
();
gGL
.
getTexUnit
(
0
)
->
unbind
(
LLTexUnit
::
TT_TEXTURE
);
gGL
.
getTexUnit
(
0
)
->
unbind
(
LLTexUnit
::
TT_TEXTURE
);
gGL
.
getTexUnit
(
1
)
->
unbind
(
LLTexUnit
::
TT_TEXTURE
);
gGL
.
getTexUnit
(
1
)
->
unbind
(
LLTexUnit
::
TT_TEXTURE
);
}
}
}
}
void
LLDrawPoolWLSky
::
renderHeavenlyBodies
(
const
LLSettingsSky
::
ptr_t
&
psky
,
const
LLVector3
&
camPosLocal
)
void
LLDrawPoolWLSky
::
renderHeavenlyBodies
()
{
{
LLGLSPipelineBlendSkyBox
gls_skybox
(
true
,
false
);
LLGLSPipelineBlendSkyBox
gls_skybox
(
true
,
false
);
gGL
.
pushMatrix
();
gGL
.
pushMatrix
();
gGL
.
translatef
(
camPosLocal
.
mV
[
0
],
camPosLocal
.
mV
[
1
],
camPosLocal
.
mV
[
2
]);
gGL
.
translatef
(
mCameraOrigin
.
mV
[
0
],
mCameraOrigin
.
mV
[
1
],
mCameraOrigin
.
mV
[
2
]);
LLFace
*
face
=
gSky
.
mVOSkyp
->
mFace
[
LLVOSky
::
FACE_SUN
];
LLFace
*
face
=
gSky
.
mVOSkyp
->
mFace
[
LLVOSky
::
FACE_SUN
];
F32
blend_factor
=
ps
ky
->
getBlendFactor
();
F32
blend_factor
=
mCurrentS
ky
->
getBlendFactor
();
bool
can_use_vertex_shaders
=
gPipeline
.
canUseVertexShaders
();
bool
can_use_vertex_shaders
=
gPipeline
.
canUseVertexShaders
();
bool
can_use_windlight_shaders
=
gPipeline
.
canUseWindLightShaders
();
bool
can_use_windlight_shaders
=
gPipeline
.
canUseWindLightShaders
();
...
@@ -512,13 +524,13 @@ void LLDrawPoolWLSky::renderHeavenlyBodies(const LLSettingsSky::ptr_t& psky, con
...
@@ -512,13 +524,13 @@ void LLDrawPoolWLSky::renderHeavenlyBodies(const LLSettingsSky::ptr_t& psky, con
//moon_shader->bindTexture(LLShaderMgr::ALTERNATE_DIFFUSE_MAP, tex_b, LLTexUnit::TT_TEXTURE);
//moon_shader->bindTexture(LLShaderMgr::ALTERNATE_DIFFUSE_MAP, tex_b, LLTexUnit::TT_TEXTURE);
}
}
F32
moon_brightness
=
(
float
)
ps
ky
->
getMoonBrightness
();
F32
moon_brightness
=
(
float
)
mCurrentS
ky
->
getMoonBrightness
();
moon_shader
->
uniform1f
(
LLShaderMgr
::
MOON_BRIGHTNESS
,
moon_brightness
);
moon_shader
->
uniform1f
(
LLShaderMgr
::
MOON_BRIGHTNESS
,
moon_brightness
);
moon_shader
->
uniform4fv
(
LLShaderMgr
::
MOONLIGHT_COLOR
,
1
,
gSky
.
mVOSkyp
->
getMoon
().
getColor
().
mV
);
moon_shader
->
uniform4fv
(
LLShaderMgr
::
MOONLIGHT_COLOR
,
1
,
gSky
.
mVOSkyp
->
getMoon
().
getColor
().
mV
);
moon_shader
->
uniform4fv
(
LLShaderMgr
::
DIFFUSE_COLOR
,
1
,
color
.
mV
);
moon_shader
->
uniform4fv
(
LLShaderMgr
::
DIFFUSE_COLOR
,
1
,
color
.
mV
);
//moon_shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor);
//moon_shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor);
moon_shader
->
uniform3fv
(
LLShaderMgr
::
DEFERRED_MOON_DIR
,
1
,
ps
ky
->
getMoonDirection
().
mV
);
// shader: moon_dir
moon_shader
->
uniform3fv
(
LLShaderMgr
::
DEFERRED_MOON_DIR
,
1
,
mCurrentS
ky
->
getMoonDirection
().
mV
);
// shader: moon_dir
face
->
renderIndexed
();
face
->
renderIndexed
();
...
@@ -540,22 +552,14 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
...
@@ -540,22 +552,14 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
}
}
LL_RECORD_BLOCK_TIME
(
FTM_RENDER_WL_SKY
);
LL_RECORD_BLOCK_TIME
(
FTM_RENDER_WL_SKY
);
LLEnvironment
&
environment
=
LLEnvironment
::
instance
();
const
F32
camHeightLocal
=
environment
.
getCamHeight
();
gGL
.
setColorMask
(
true
,
false
);
gGL
.
setColorMask
(
true
,
false
);
LLVector3
const
&
origin
=
LLViewerCamera
::
getInstance
()
->
getOrigin
();
if
(
gPipeline
.
canUseWindLightShaders
())
if
(
gPipeline
.
canUseWindLightShaders
())
{
{
const
LLSettingsSky
::
ptr_t
&
psky
=
environment
.
getCurrentSky
();
renderSkyHazeDeferred
();
renderStarsDeferred
();
renderSkyHazeDeferred
(
psky
,
origin
,
camHeightLocal
);
renderHeavenlyBodies
();
renderStarsDeferred
(
psky
,
origin
);
renderSkyClouds
();
renderHeavenlyBodies
(
psky
,
origin
);
renderSkyClouds
(
psky
,
origin
,
camHeightLocal
,
cloud_shader
);
}
}
gGL
.
setColorMask
(
true
,
true
);
gGL
.
setColorMask
(
true
,
true
);
}
}
...
@@ -568,17 +572,10 @@ void LLDrawPoolWLSky::render(S32 pass)
...
@@ -568,17 +572,10 @@ void LLDrawPoolWLSky::render(S32 pass)
}
}
LL_RECORD_BLOCK_TIME
(
FTM_RENDER_WL_SKY
);
LL_RECORD_BLOCK_TIME
(
FTM_RENDER_WL_SKY
);
LLEnvironment
&
environment
=
LLEnvironment
::
instance
();
renderSkyHaze
();
renderStars
();
const
F32
camHeightLocal
=
environment
.
getCamHeight
();
renderHeavenlyBodies
();
LLVector3
const
&
origin
=
LLViewerCamera
::
getInstance
()
->
getOrigin
();
renderSkyClouds
();
const
LLSettingsSky
::
ptr_t
&
psky
=
environment
.
getCurrentSky
();
renderSkyHaze
(
origin
,
camHeightLocal
);
renderStars
(
psky
,
origin
);
renderHeavenlyBodies
(
psky
,
origin
);
renderSkyClouds
(
psky
,
origin
,
camHeightLocal
,
cloud_shader
);
gGL
.
getTexUnit
(
0
)
->
unbind
(
LLTexUnit
::
TT_TEXTURE
);
gGL
.
getTexUnit
(
0
)
->
unbind
(
LLTexUnit
::
TT_TEXTURE
);
}
}
...
...
This diff is collapsed.
Click to expand it.
indra/newview/lldrawpoolwlsky.h
+
11
−
7
View file @
43eda06e
...
@@ -71,16 +71,20 @@ class LLDrawPoolWLSky final : public LLDrawPool {
...
@@ -71,16 +71,20 @@ class LLDrawPoolWLSky final : public LLDrawPool {
static
void
cleanupGL
();
static
void
cleanupGL
();
static
void
restoreGL
();
static
void
restoreGL
();
private
:
private
:
void
renderDome
(
const
LLVector3
&
camPosLocal
,
F32
camHeightLocal
,
LLGLSLShader
*
shader
)
const
;
void
renderDome
(
LLGLSLShader
*
shader
)
const
;
void
renderSkyHaze
(
const
LLVector3
&
camPosLocal
,
F32
camHeightLocal
)
const
;
void
renderSkyHaze
()
const
;
void
renderSkyClouds
(
const
LLSettingsSky
::
ptr_t
&
psky
,
const
LLVector3
&
camPosLocal
,
F32
camHeightLocal
,
LLGLSLShader
*
cloudshader
)
const
;
void
renderSkyClouds
()
const
;
void
renderSkyHazeDeferred
(
const
LLSettingsSky
::
ptr_t
&
psky
,
const
LLVector3
&
camPosLocal
,
F32
camHeightLocal
)
const
;
void
renderSkyHazeDeferred
()
const
;
void
renderStarsDeferred
(
const
LLSettingsSky
::
ptr_t
&
psky
,
const
LLVector3
&
camPosLocal
)
const
;
void
renderStarsDeferred
()
const
;
void
renderStars
(
const
LLSettingsSky
::
ptr_t
&
psky
,
const
LLVector3
&
camPosLocal
)
const
;
void
renderStars
()
const
;
void
renderHeavenlyBodies
(
const
LLSettingsSky
::
ptr_t
&
psky
,
const
LLVector3
&
camPosLocal
);
void
renderHeavenlyBodies
();
LLVector3
mCameraOrigin
;
LLSettingsSky
::
ptr_t
mCurrentSky
;
F32
mCamHeightLocal
=
0.
f
;
};
};
#endif // LL_DRAWPOOLWLSKY_H
#endif // LL_DRAWPOOLWLSKY_H
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