Skip to content
Snippets Groups Projects
Commit ee73a524 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Fix stars being stuck at the ground.

parent 086c08c5
No related branches found
No related tags found
No related merge requests found
...@@ -215,7 +215,7 @@ void LLDrawPoolWLSky::renderSkyHaze(const LLVector3& camPosLocal, F32 camHeightL ...@@ -215,7 +215,7 @@ void LLDrawPoolWLSky::renderSkyHaze(const LLVector3& camPosLocal, F32 camHeightL
} }
} }
void LLDrawPoolWLSky::renderStars(const LLSettingsSky::ptr_t& psky) const void LLDrawPoolWLSky::renderStars(const LLSettingsSky::ptr_t& psky, const LLVector3& camPosLocal) const
{ {
LLGLSPipelineBlendSkyBox gls_skybox(true, false); LLGLSPipelineBlendSkyBox gls_skybox(true, false);
...@@ -257,7 +257,7 @@ void LLDrawPoolWLSky::renderStars(const LLSettingsSky::ptr_t& psky) const ...@@ -257,7 +257,7 @@ void LLDrawPoolWLSky::renderStars(const LLSettingsSky::ptr_t& psky) const
} }
gGL.pushMatrix(); gGL.pushMatrix();
gGL.rotatef(gFrameTimeSeconds*0.01f, 0.f, 0.f, 1.f); gGL.translatef(camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]);
if (LLGLSLShader::sNoFixedFunction) if (LLGLSLShader::sNoFixedFunction)
{ {
gCustomAlphaProgram.bind(); gCustomAlphaProgram.bind();
...@@ -287,7 +287,7 @@ void LLDrawPoolWLSky::renderStars(const LLSettingsSky::ptr_t& psky) const ...@@ -287,7 +287,7 @@ void LLDrawPoolWLSky::renderStars(const LLSettingsSky::ptr_t& psky) const
} }
} }
void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky) const void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky, const LLVector3& camPosLocal) const
{ {
LLGLSPipelineBlendSkyBox gls_sky(true, false); LLGLSPipelineBlendSkyBox gls_sky(true, false);
...@@ -304,7 +304,7 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky) cons ...@@ -304,7 +304,7 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky) cons
return; return;
} }
gDeferredStarProgram.bind();
LLViewerTexture* tex_a = gSky.mVOSkyp->getBloomTex(); LLViewerTexture* tex_a = gSky.mVOSkyp->getBloomTex();
LLViewerTexture* tex_b = gSky.mVOSkyp->getBloomTexNext(); LLViewerTexture* tex_b = gSky.mVOSkyp->getBloomTexNext();
...@@ -330,6 +330,11 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky) cons ...@@ -330,6 +330,11 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky) cons
gGL.getTexUnit(1)->bind(tex_b); gGL.getTexUnit(1)->bind(tex_b);
} }
gGL.pushMatrix();
gGL.translatef(camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]);
gDeferredStarProgram.bind();
gDeferredStarProgram.uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor); gDeferredStarProgram.uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor);
if (LLPipeline::sReflectionRender) if (LLPipeline::sReflectionRender)
...@@ -347,6 +352,8 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky) cons ...@@ -347,6 +352,8 @@ void LLDrawPoolWLSky::renderStarsDeferred(const LLSettingsSky::ptr_t& psky) cons
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);
gGL.popMatrix();
gDeferredStarProgram.unbind(); gDeferredStarProgram.unbind();
} }
...@@ -539,7 +546,7 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) ...@@ -539,7 +546,7 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
const LLSettingsSky::ptr_t& psky = environment.getCurrentSky(); const LLSettingsSky::ptr_t& psky = environment.getCurrentSky();
renderSkyHazeDeferred(psky, origin, camHeightLocal); renderSkyHazeDeferred(psky, origin, camHeightLocal);
renderStarsDeferred(psky); renderStarsDeferred(psky, origin);
renderHeavenlyBodies(psky, origin); renderHeavenlyBodies(psky, origin);
renderSkyClouds(psky, origin, camHeightLocal, cloud_shader); renderSkyClouds(psky, origin, camHeightLocal, cloud_shader);
} }
...@@ -562,7 +569,7 @@ void LLDrawPoolWLSky::render(S32 pass) ...@@ -562,7 +569,7 @@ void LLDrawPoolWLSky::render(S32 pass)
const LLSettingsSky::ptr_t& psky = environment.getCurrentSky(); const LLSettingsSky::ptr_t& psky = environment.getCurrentSky();
renderSkyHaze(origin, camHeightLocal); renderSkyHaze(origin, camHeightLocal);
renderStars(psky); renderStars(psky, origin);
renderHeavenlyBodies(psky, origin); renderHeavenlyBodies(psky, origin);
renderSkyClouds(psky, origin, camHeightLocal, cloud_shader); renderSkyClouds(psky, origin, camHeightLocal, cloud_shader);
......
...@@ -78,8 +78,8 @@ class LLDrawPoolWLSky final : public LLDrawPool { ...@@ -78,8 +78,8 @@ class LLDrawPoolWLSky final : public LLDrawPool {
void renderSkyHazeDeferred(const LLSettingsSky::ptr_t& psky, const LLVector3& camPosLocal, F32 camHeightLocal) const; void renderSkyHazeDeferred(const LLSettingsSky::ptr_t& psky, const LLVector3& camPosLocal, F32 camHeightLocal) const;
void renderStarsDeferred(const LLSettingsSky::ptr_t& psky) const; void renderStarsDeferred(const LLSettingsSky::ptr_t& psky, const LLVector3& camPosLocal) const;
void renderStars(const LLSettingsSky::ptr_t& psky) const; void renderStars(const LLSettingsSky::ptr_t& psky, const LLVector3& camPosLocal) const;
void renderHeavenlyBodies(const LLSettingsSky::ptr_t& psky, const LLVector3& camPosLocal); void renderHeavenlyBodies(const LLSettingsSky::ptr_t& psky, const LLVector3& camPosLocal);
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment