summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-10-30 00:05:31 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-10-30 12:55:05 +0200
commitfa055104fc66f7b8779b3d3d399cd9cbb4057e76 (patch)
tree955ad0e22fa024172b425dafed3a0d1e759c937d
parent88aa94f9c445c8778ec43e774c41858983ca72dc (diff)
#3649 Incorrect camera aspec ratio
Everything else uses width/height ratio
-rw-r--r--indra/newview/llgltfmaterialpreviewmgr.cpp2
-rw-r--r--indra/newview/llterrainpaintmap.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/indra/newview/llgltfmaterialpreviewmgr.cpp b/indra/newview/llgltfmaterialpreviewmgr.cpp
index 5a6e9565ae..ebb9dc3e3c 100644
--- a/indra/newview/llgltfmaterialpreviewmgr.cpp
+++ b/indra/newview/llgltfmaterialpreviewmgr.cpp
@@ -462,7 +462,7 @@ bool LLGLTFPreviewTexture::render()
// Set up camera and viewport
const LLVector3 origin(0.0, 0.0, 0.0);
camera.lookAt(origin, object_position);
- camera.setAspect((F32)(mFullHeight / mFullWidth));
+ camera.setAspect((F32)(mFullWidth / mFullHeight));
const LLRect texture_rect(0, mFullHeight, mFullWidth, 0);
camera.setPerspective(NOT_FOR_SELECTION, texture_rect.mLeft, texture_rect.mBottom, texture_rect.getWidth(), texture_rect.getHeight(), false, camera.getNear(), MAX_FAR_CLIP*2.f);
diff --git a/indra/newview/llterrainpaintmap.cpp b/indra/newview/llterrainpaintmap.cpp
index c7a82013e4..f95f248139 100644
--- a/indra/newview/llterrainpaintmap.cpp
+++ b/indra/newview/llterrainpaintmap.cpp
@@ -107,7 +107,7 @@ bool LLTerrainPaintMap::bakeHeightNoiseIntoPBRPaintMapRGB(const LLViewerRegion&
const LLVector3 region_center = LLVector3(region_half_width, region_half_width, 0.0) + region.getOriginAgent();
const LLVector3 camera_origin = LLVector3(0.0f, 0.0f, region_camera_height) + region_center;
camera.lookAt(camera_origin, region_center, LLVector3::y_axis);
- camera.setAspect(F32(scratch_target.getHeight()) / F32(scratch_target.getWidth()));
+ camera.setAspect(F32(scratch_target.getWidth()) / F32(scratch_target.getHeight()));
const LLRect texture_rect(0, scratch_target.getHeight(), scratch_target.getWidth(), 0);
glViewport(texture_rect.mLeft, texture_rect.mBottom, texture_rect.getWidth(), texture_rect.getHeight());
// Manually get modelview matrix from camera orientation.