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.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp
index e38ba8762a..cf6b08797d 100644
--- a/indra/newview/llgltfmaterialpreviewmgr.cpp
+++ b/indra/newview/llgltfmaterialpreviewmgr.cpp
@@ -193,7 +193,7 @@ LLGLTFPreviewTexture::LLGLTFPreviewTexture(LLPointer<LLFetchedGLTFMaterial> mate
// static
LLPointer<LLGLTFPreviewTexture> LLGLTFPreviewTexture::create(LLPointer<LLFetchedGLTFMaterial> material)
{
- return new LLGLTFPreviewTexture(material, LLPipeline::MAX_BAKE_WIDTH);
+ return new LLGLTFPreviewTexture(material, LLPipeline::MAX_PREVIEW_WIDTH);
}
bool LLGLTFPreviewTexture::needsRender()
@@ -471,10 +471,10 @@ bool LLGLTFPreviewTexture::render()
PreviewSphere& preview_sphere = get_preview_sphere(mGLTFMaterial, object_transform);
gPipeline.setupHWLights();
- glh::matrix4f mat = copy_matrix(gGLModelView);
- glh::vec4f transformed_light_dir(light_dir.mV);
- mat.mult_matrix_vec(transformed_light_dir);
- SetTemporarily<LLVector4> force_sun_direction_high_graphics(&gPipeline.mTransformedSunDir, LLVector4(transformed_light_dir.v));
+ glm::mat4 mat = get_current_modelview();
+ glm::vec4 transformed_light_dir = glm::make_vec4(light_dir.mV);
+ transformed_light_dir = mat * transformed_light_dir;
+ SetTemporarily<LLVector4> force_sun_direction_high_graphics(&gPipeline.mTransformedSunDir, LLVector4(glm::value_ptr(transformed_light_dir)));
// Override lights to ensure the sun is always shining from a certain direction (low graphics)
// See also force_sun_direction_high_graphics and fixup_shader_constants
{