summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-04-20 18:14:37 +0000
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-04-20 18:14:37 +0000
commit9634bcf488f45675e53a761808f59881b57cbe8c (patch)
tree40b695d7acb23e381331bda92c9f7550d655749e /indra/newview/llfloatermodelpreview.cpp
parentde17c53ae32fef76827201ed24a5af137af12313 (diff)
parentd7f1c88c35849e56f5b352f13c16a08467d1533b (diff)
Merged master into DRTVWR-508
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rw-r--r--indra/newview/llfloatermodelpreview.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 35362c0c7c..bc44e37c5a 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -107,6 +107,10 @@ const double RETAIN_COEFFICIENT = 100;
// So this const is used as a size of Smooth combobox list.
const S32 SMOOTH_VALUES_NUMBER = 10;
+// mCameraDistance
+// Also see: mCameraZoom
+const F32 MODEL_PREVIEW_CAMERA_DISTANCE = 16.f;
+
void drawBoxOutline(const LLVector3& pos, const LLVector3& size);
@@ -430,7 +434,7 @@ void LLFloaterModelPreview::initModelPreview()
}
mModelPreview = new LLModelPreview(512, 512, this );
- mModelPreview->setPreviewTarget(16.f);
+ mModelPreview->setPreviewTarget(MODEL_PREVIEW_CAMERA_DISTANCE);
mModelPreview->setDetailsCallback(boost::bind(&LLFloaterModelPreview::setDetails, this, _1, _2, _3, _4, _5));
mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::modelUpdated, this, _1));
}
@@ -3640,10 +3644,9 @@ BOOL LLModelPreview::render()
S32 width = getWidth();
S32 height = getHeight();
- LLGLSUIDefault def;
+ LLGLSUIDefault def; // GL_BLEND, GL_ALPHA_TEST, GL_CULL_FACE, depth test
LLGLDisable no_blend(GL_BLEND);
- LLGLEnable cull(GL_CULL_FACE);
- LLGLDepthTest depth(GL_TRUE);
+ LLGLDepthTest depth(GL_FALSE); // SL-12781 disable z-buffer to render background color
LLGLDisable fog(GL_FOG);
{
@@ -3651,7 +3654,7 @@ BOOL LLModelPreview::render()
{
gUIProgram.bind();
}
- //clear background to blue
+ //clear background to grey
gGL.matrixMode(LLRender::MM_PROJECTION);
gGL.pushMatrix();
gGL.loadIdentity();
@@ -3756,7 +3759,7 @@ BOOL LLModelPreview::render()
F32 explode = mFMP->childGetValue("physics_explode").asReal();
- glClear(GL_DEPTH_BUFFER_BIT);
+ LLGLDepthTest gls_depth(GL_TRUE); // SL-12781 re-enable z-buffer for 3D model preview
LLRect preview_rect;
@@ -3779,7 +3782,6 @@ BOOL LLModelPreview::render()
target_pos = getPreviewAvatar()->getPositionAgent();
z_near = 0.01f;
z_far = 1024.f;
- mCameraDistance = 16.f;
//render avatar previews every frame
refresh();
@@ -3919,9 +3921,9 @@ BOOL LLModelPreview::render()
{
glClear(GL_DEPTH_BUFFER_BIT);
- for (U32 i = 0; i < 2; i++)
+ for (U32 pass = 0; pass < 2; pass++)
{
- if (i == 0)
+ if (pass == 0)
{ //depth only pass
gGL.setColorMask(false, false);
}
@@ -3931,7 +3933,7 @@ BOOL LLModelPreview::render()
}
//enable alpha blending on second pass but not first pass
- LLGLState blend(GL_BLEND, i);
+ LLGLState blend(GL_BLEND, pass);
gGL.blendFunc(LLRender::BF_SOURCE_ALPHA, LLRender::BF_ONE_MINUS_SOURCE_ALPHA);
@@ -4037,7 +4039,7 @@ BOOL LLModelPreview::render()
glLineWidth(3.f);
glPointSize(8.f);
- gPipeline.enableLightsFullbright(LLColor4::white);
+ gPipeline.enableLightsFullbright();
//show degenerate triangles
LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS);
LLGLDisable cull(GL_CULL_FACE);