summaryrefslogtreecommitdiff
path: root/indra/newview/llgltfmaterialpreviewmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llgltfmaterialpreviewmgr.cpp')
-rw-r--r--indra/newview/llgltfmaterialpreviewmgr.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp
index a8ea3429f4..53d9d7d0ba 100644
--- a/indra/newview/llgltfmaterialpreviewmgr.cpp
+++ b/indra/newview/llgltfmaterialpreviewmgr.cpp
@@ -34,6 +34,7 @@
#include "llenvironment.h"
#include "llselectmgr.h"
#include "llviewercamera.h"
+#include "llviewercontrol.h"
#include "llviewerobject.h"
#include "llviewershadermgr.h"
#include "llviewertexturelist.h"
@@ -95,7 +96,7 @@ namespace
{
void fetch_texture_for_ui(LLPointer<LLViewerFetchedTexture>& img, const LLUUID& id)
{
- if (id.notNull())
+ if (!img && id.notNull())
{
if (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::isBakedImageId(id))
{
@@ -129,6 +130,8 @@ namespace
LLGLTFPreviewTexture::MaterialLoadLevels get_material_load_levels(LLFetchedGLTFMaterial& material)
{
+ llassert(!material.isFetching());
+
using MaterialTextures = LLPointer<LLViewerFetchedTexture>*[LLGLTFMaterial::GLTF_TEXTURE_INFO_COUNT];
MaterialTextures textures;
@@ -334,7 +337,7 @@ void set_preview_sphere_material(PreviewSphere& preview_sphere, LLPointer<LLFetc
info->mGLTFMaterial = material;
LLVertexBuffer* buf = info->mVertexBuffer.get();
LLStrider<LLColor4U> colors;
- const S32 count = info->mEnd - info->mStart;
+ const S32 count = info->mEnd - info->mStart + 1;
buf->getColorStrider(colors, info->mStart, count);
for (S32 i = 0; i < count; ++i)
{
@@ -419,7 +422,8 @@ BOOL LLGLTFPreviewTexture::render()
LLVector3 light_dir3(1.0f, 1.0f, 1.0f);
light_dir3.normalize();
const LLVector4 light_dir = LLVector4(light_dir3, 0);
- SetTemporarily<S32> sun_light_only(&LLPipeline::RenderLocalLightCount, 0);
+ const S32 old_local_light_count = gSavedSettings.get<S32>("RenderLocalLightCount");
+ gSavedSettings.set<S32>("RenderLocalLightCount", 0);
gPipeline.mReflectionMapManager.forceDefaultProbeAndUpdateUniforms();
@@ -524,6 +528,7 @@ BOOL LLGLTFPreviewTexture::render()
// Clean up
gPipeline.setupHWLights();
gPipeline.mReflectionMapManager.forceDefaultProbeAndUpdateUniforms(false);
+ gSavedSettings.set<S32>("RenderLocalLightCount", old_local_light_count);
return TRUE;
}