diff options
author | Graham Linden <graham@lindenlab.com> | 2019-03-21 10:39:14 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-03-21 10:39:14 -0700 |
commit | 7423a86a1bb7b87c70b5ccc3dbfb13ebb4f28668 (patch) | |
tree | a6bf3a4ec616b309df8628e6ec7790561c1dd556 /indra/newview/llvowlsky.cpp | |
parent | edf8ba6e5ff0fc2b5ef55219c82af7b0f20437d9 (diff) |
SL-10751
Fix skydome VB generation to cover entire range of phi (give sky pants).
Add shader code to fade out clouds to simulate old look at altitude.
Diffstat (limited to 'indra/newview/llvowlsky.cpp')
-rw-r--r-- | indra/newview/llvowlsky.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp index 37689e0683..40cb0d2c24 100644 --- a/indra/newview/llvowlsky.cpp +++ b/indra/newview/llvowlsky.cpp @@ -111,7 +111,7 @@ inline F32 LLVOWLSky::calcPhi(U32 i) t = t*t; t = 1.f - t; - return F_PI_BY_TWO * t; + return F_PI * t; } void LLVOWLSky::resetVertexBuffers() @@ -248,8 +248,11 @@ BOOL LLVOWLSky::updateGeometry(LLDrawable * drawable) LL_ERRS() << "Failed updating WindLight sky geometry." << LL_ENDL; } + U32 vertex_count = 0; + U32 index_count = 0; + // fill it - buildStripsBuffer(begin_stack, end_stack, vertices, texCoords, indices); + buildStripsBuffer(begin_stack, end_stack, vertex_count, index_count, vertices, texCoords, indices); // and unlock the buffer segment->flush(); @@ -360,7 +363,10 @@ void LLVOWLSky::initStars() } } -void LLVOWLSky::buildStripsBuffer(U32 begin_stack, U32 end_stack, +void LLVOWLSky::buildStripsBuffer(U32 begin_stack, + U32 end_stack, + U32& vertex_count, + U32& index_count, LLStrider<LLVector3> & vertices, LLStrider<LLVector2> & texCoords, LLStrider<U16> & indices) @@ -380,7 +386,7 @@ void LLVOWLSky::buildStripsBuffer(U32 begin_stack, U32 end_stack, llassert(end_stack <= num_stacks); // stacks are iterated one-indexed since phi(0) was handled by the fan above - for(i = begin_stack + 1; i <= end_stack+1; ++i) + for(i = begin_stack; i <= end_stack; ++i) { phi0 = calcPhi(i); @@ -434,6 +440,9 @@ void LLVOWLSky::buildStripsBuffer(U32 begin_stack, U32 end_stack, *indices++ = i * num_slices + k ; count_indices++ ; } + + vertex_count = count_verts; + index_count = count_indices; } void LLVOWLSky::updateStarColors() |