Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for mirrors not functioning properly under water. #1436

Merged
merged 18 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
push:
branches: ["main", "release/*", "project/*"]
tags: ["Second_Life_*"]
tags: ["Second_Life*"]

jobs:
build:
Expand Down Expand Up @@ -176,16 +176,22 @@ jobs:
# seen before, so numerous tests don't know about it.
[[ "$arch" == "MINGW6" ]] && arch=CYGWIN
export AUTOBUILD="$(which autobuild)"
# Build with a tag like "Second_Life_Project_Shiny#abcdef0" to get a
# viewer channel "Second Life Project Shiny" (ignoring "#hash",
# needed to disambiguate tags).
if [[ "$GITHUB_REF_TYPE" == "tag" && "${GITHUB_REF_NAME:0:12}" == "Second_Life_" ]]
then viewer_channel="${GITHUB_REF_NAME%#*}"
export viewer_channel="${viewer_channel//_/ }"
else export viewer_channel="Second Life Test"

# determine the viewer channel from the branch name
branch=$AUTOBUILD_VCS_BRANCH
IFS='/' read -ra ba <<< $branch
prefix=${ba[0]}
if [ "$prefix" == "project" ]; then
IFS='_' read -ra prj <<< "${ba[1]}"
# uppercase first letter of each word
export viewer_channel="Second Life Project ${prj[*]^}"
elif [[ "$prefix" == "release" || "$prefix" == "main" ]];
then
export viewer_channel="Second Life Release"
else
export viewer_channel="Second Life Test"
fi
echo "viewer_channel=$viewer_channel" >> "$GITHUB_OUTPUT"

# On windows we need to point the build to the correct python
# as neither CMake's FindPython nor our custom Python.cmake module
# will resolve the correct interpreter location.
Expand Down Expand Up @@ -354,7 +360,8 @@ jobs:
release:
needs: [build, sign-and-package-windows, sign-and-package-mac]
runs-on: ubuntu-latest
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life_')
# Build with a tag like "Second_Life#abcdef0" to generate a release page (used for builds we are planning to deploy).
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'Second_Life')
steps:
- uses: actions/download-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ pre_build()

"$autobuild" configure --quiet -c $variant \
${eval_autobuild_configure_parameters:---} \
-DLL_TESTS:BOOL=ON \
-DPACKAGE:BOOL=ON \
-DHAVOK:BOOL="$HAVOK" \
-DRELEASE_CRASH_REPORTING:BOOL="$RELEASE_CRASH_REPORTING" \
Expand Down
2 changes: 1 addition & 1 deletion indra/llimage/tests/llimageworker_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace tut
done = res;
*done = false;
}
virtual void completed(bool success, LLImageRaw* raw, LLImageRaw* aux)
virtual void completed(bool success, LLImageRaw* raw, LLImageRaw* aux, U32)
{
*done = true;
}
Expand Down
12 changes: 7 additions & 5 deletions indra/llprimitive/llgltfmaterial.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ class LLGLTFMaterial : public LLRefCount
F32 mRoughnessFactor = 1.f;
F32 mAlphaCutoff = 0.5f;

bool mDoubleSided = false;
AlphaMode mAlphaMode = ALPHA_MODE_OPAQUE;

bool mDoubleSided = false;

// override specific flags for state that can't use off-by-epsilon or UUID hack
bool mOverrideDoubleSided = false;
bool mOverrideAlphaMode = false;
Expand All @@ -139,6 +140,11 @@ class LLGLTFMaterial : public LLRefCount
// heightmaps cannot currently be described as finite enclosed
// volumes.
// See also LLPanelRegionTerrainInfo::validateMaterials
// These fields are local to viewer and are a part of local bitmap support
typedef std::map<LLUUID, LLUUID> local_tex_map_t;
local_tex_map_t mTrackingIdToLocalTexture;

public:

// get a UUID based on a hash of this LLGLTFMaterial
LLUUID getHash() const;
Expand Down Expand Up @@ -240,10 +246,6 @@ class LLGLTFMaterial : public LLRefCount
virtual bool replaceLocalTexture(const LLUUID& tracking_id, const LLUUID &old_id, const LLUUID& new_id);
virtual void updateTextureTracking();

// These fields are local to viewer and are a part of local bitmap support
typedef std::map<LLUUID, LLUUID> local_tex_map_t;
local_tex_map_t mTrackingIdToLocalTexture;

protected:
static LLVector2 vec2FromJson(const std::map<std::string, tinygltf::Value>& object, const char* key, const LLVector2& default_value);
static F32 floatFromJson(const std::map<std::string, tinygltf::Value>& object, const char* key, const F32 default_value);
Expand Down
2 changes: 1 addition & 1 deletion indra/llprimitive/tests/llgltfmaterial_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ namespace tut
#if LL_WINDOWS
// If any fields are added/changed, these tests should be updated (consider also updating ASSET_VERSION in LLGLTFMaterial)
// This test result will vary between compilers, so only test a single platform
ensure_equals("fields supported for GLTF (sizeof check)", sizeof(LLGLTFMaterial), 216);
ensure_equals("fields supported for GLTF (sizeof check)", sizeof(LLGLTFMaterial), 224);
#endif
#endif
ensure_equals("LLGLTFMaterial texture info count", (U32)LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT, 4);
Expand Down
3 changes: 2 additions & 1 deletion indra/newview/pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,8 @@ static LLTrace::BlockTimerStatHandle FTM_CULL("Object Culling");
// static
bool LLPipeline::isWaterClip()
{
return (!sRenderTransparentWater || gCubeSnapshot) && !sRenderingHUDs;
// We always pretend that we're not clipping water when rendering mirrors.
return (gPipeline.mHeroProbeManager.isMirrorPass()) ? false : (!sRenderTransparentWater || gCubeSnapshot) && !sRenderingHUDs;
}

void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result)
Expand Down
Loading