Remove some dead code.

Add LH transform to LLVector3
Add DebugShowUploadCost
Make LOD generation on model preview less finnicky.
Remove error level based LOD generation.
Better framing of model before upload.
Better error handling for model uploader.
Remove [COST] argument from model upload menu item.
Remove L$ check from model upload menu item being enabled.
master
Dave Parks 2010-02-28 16:40:30 -06:00
parent 1ceceecf75
commit b414b5067e
15 changed files with 145 additions and 43 deletions

View File

@ -684,37 +684,6 @@ const LLMatrix4& LLMatrix4::initMatrix(const LLMatrix3 &mat, const LLVector4 &
// LLMatrix4 Operators
/* Not implemented to help enforce code consistency with the syntax of
row-major notation. This is a Good Thing.
LLVector4 operator*(const LLMatrix4 &a, const LLVector4 &b)
{
// Operate "to the right" on column-vector b
LLVector4 vec;
vec.mV[VX] = a.mMatrix[VX][VX] * b.mV[VX] +
a.mMatrix[VY][VX] * b.mV[VY] +
a.mMatrix[VZ][VX] * b.mV[VZ] +
a.mMatrix[VW][VX] * b.mV[VW];
vec.mV[VY] = a.mMatrix[VX][VY] * b.mV[VX] +
a.mMatrix[VY][VY] * b.mV[VY] +
a.mMatrix[VZ][VY] * b.mV[VZ] +
a.mMatrix[VW][VY] * b.mV[VW];
vec.mV[VZ] = a.mMatrix[VX][VZ] * b.mV[VX] +
a.mMatrix[VY][VZ] * b.mV[VY] +
a.mMatrix[VZ][VZ] * b.mV[VZ] +
a.mMatrix[VW][VZ] * b.mV[VW];
vec.mV[VW] = a.mMatrix[VX][VW] * b.mV[VX] +
a.mMatrix[VY][VW] * b.mV[VY] +
a.mMatrix[VZ][VW] * b.mV[VZ] +
a.mMatrix[VW][VW] * b.mV[VW];
return vec;
}
*/
LLVector4 operator*(const LLVector4 &a, const LLMatrix4 &b)
{
// Operate "to the left" on row-vector a

View File

@ -226,10 +226,7 @@ public:
// Operators
//
// Not implemented to enforce code that agrees with symbolic syntax
// friend LLVector4 operator*(const LLMatrix4 &a, const LLVector4 &b); // Apply rotation a to vector b
// friend inline LLMatrix4 operator*(const LLMatrix4 &a, const LLMatrix4 &b); // Return a * b
// friend inline LLMatrix4 operator*(const LLMatrix4 &a, const LLMatrix4 &b); // Return a * b
friend LLVector4 operator*(const LLVector4 &a, const LLMatrix4 &b); // Return transform of vector a by matrix b
friend const LLVector3 operator*(const LLVector3 &a, const LLMatrix4 &b); // Return full transform of a by matrix b
friend LLVector4 rotate_vector(const LLVector4 &a, const LLMatrix4 &b); // Rotates a but does not translate

View File

@ -197,6 +197,28 @@ const LLVector3& LLVector3::rotVec(const LLQuaternion &q)
return *this;
}
const LLVector3& LLVector3::transVec(const LLMatrix4& mat)
{
setVec(
mV[VX] * mat.mMatrix[VX][VX] +
mV[VY] * mat.mMatrix[VX][VY] +
mV[VZ] * mat.mMatrix[VX][VZ] +
mat.mMatrix[VX][VW],
mV[VX] * mat.mMatrix[VY][VX] +
mV[VY] * mat.mMatrix[VY][VY] +
mV[VZ] * mat.mMatrix[VY][VZ] +
mat.mMatrix[VY][VW],
mV[VX] * mat.mMatrix[VZ][VX] +
mV[VY] * mat.mMatrix[VZ][VY] +
mV[VZ] * mat.mMatrix[VZ][VZ] +
mat.mMatrix[VZ][VW]);
return *this;
}
const LLVector3& LLVector3::rotVec(F32 angle, const LLVector3 &vec)
{
if ( !vec.isExactlyZero() && angle )

View File

@ -36,10 +36,12 @@
#include "llerror.h"
#include "llmath.h"
#include "llsd.h"
class LLVector2;
class LLVector4;
class LLMatrix3;
class LLMatrix4;
class LLVector3d;
class LLQuaternion;
@ -115,6 +117,7 @@ class LLVector3
const LLVector3& rotVec(F32 angle, F32 x, F32 y, F32 z); // Rotates about x,y,z by angle radians
const LLVector3& rotVec(const LLMatrix3 &mat); // Rotates by LLMatrix4 mat
const LLVector3& rotVec(const LLQuaternion &q); // Rotates by LLQuaternion q
const LLVector3& transVec(const LLMatrix4& mat); // Transforms by LLMatrix4 mat (mat * v)
const LLVector3& scaleVec(const LLVector3& vec); // scales per component by vec
LLVector3 scaledVec(const LLVector3& vec) const; // get a copy of this vector scaled by vec

View File

@ -668,6 +668,12 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
{
LLMemType mt2(LLMemType::MTYPE_VERTEX_ALLOCATE_BUFFER);
if (nverts < 0 || nindices < 0 ||
nverts > 65536)
{
llerrs << "Bad vertex buffer allocation: " << nverts << " : " << nindices << llendl;
}
updateNumVerts(nverts);
updateNumIndices(nindices);

View File

@ -1687,7 +1687,7 @@
<key>DebugShowRenderInfo</key>
<map>
<key>Comment</key>
<string>Show depth buffer contents</string>
<string>Show stats about current scene</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -1695,6 +1695,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>DebugShowUploadCost</key>
<map>
<key>Comment</key>
<string>Show what it would cost to upload assets in current scene</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>DebugShowRenderMatrices</key>
<map>
<key>Comment</key>

View File

@ -445,8 +445,7 @@ void init_menus()
gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", upload_cost);
gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", upload_cost);
gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", upload_cost);
gMenuHolder->childSetLabelArg("Upload Model", "[COST]", upload_cost);
gAFKMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Away", TRUE);
gBusyMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Busy", TRUE);
gAttachSubMenu = gMenuBarView->findChildMenuByName("Attach Object", TRUE);

View File

@ -92,6 +92,15 @@ class LLFileEnableUpload : public view_listener_t
}
};
class LLFileEnableUploadModel : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
bool new_value = gAgent.getRegion() && !gAgent.getRegion()->getCapability("NewFileAgentInventoryVariablePrice").empty();
return new_value;
}
};
//============================================================================
#if LL_WINDOWS
@ -1283,6 +1292,7 @@ void init_menu_file()
view_listener_t::addCommit(new LLFileQuit(), "File.Quit");
view_listener_t::addEnable(new LLFileEnableUpload(), "File.EnableUpload");
view_listener_t::addEnable(new LLFileEnableUploadModel(), "File.EnableUploadModel");
// "File.SaveTexture" moved to llpanelmaininventory so that it can be properly handled.
}

View File

@ -4842,7 +4842,6 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/)
gMenuHolder->childSetLabelArg("Upload Image", "[COST]", llformat("%d", upload_cost));
gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", llformat("%d", upload_cost));
gMenuHolder->childSetLabelArg("Upload Model", "[COST]", llformat("%d", upload_cost));
gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", llformat("%d", upload_cost));
gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", llformat("%d", upload_cost));
}

View File

@ -584,6 +584,20 @@ public:
}
}
if (gSavedSettings.getBOOL("DebugShowUploadCost"))
{
addText(xpos, ypos, llformat(" Meshes: L$%d", gPipeline.mDebugMeshUploadCost));
ypos += y_inc/2.f;
addText(xpos, ypos, llformat(" Sculpties: L$%d", gPipeline.mDebugSculptUploadCost));
ypos += y_inc/2.f;
addText(xpos, ypos, llformat(" Textures: L$%d", gPipeline.mDebugTextureUploadCost));
ypos += y_inc/2.f;
addText(xpos, ypos, "Upload Cost: ");
ypos += y_inc;
}
//temporary hack to give feedback on mesh upload progress
if (!gMeshRepo.mUploads.empty())
{

View File

@ -3553,6 +3553,63 @@ void LLPipeline::renderDebug()
}
}
if (gSavedSettings.getBOOL("DebugShowUploadCost"))
{
std::set<LLUUID> textures;
std::set<LLUUID> sculpts;
std::set<LLUUID> meshes;
BOOL selected = TRUE;
if (LLSelectMgr::getInstance()->getSelection()->isEmpty())
{
selected = FALSE;
}
for (LLCullResult::sg_list_t::iterator iter = sCull->beginVisibleGroups(); iter != sCull->endVisibleGroups(); ++iter)
{
LLSpatialGroup* group = *iter;
LLSpatialGroup::OctreeNode* node = group->mOctreeNode;
for (LLSpatialGroup::OctreeNode::element_iter elem = node->getData().begin(); elem != node->getData().end(); ++elem)
{
LLDrawable* drawable = *elem;
LLVOVolume* volume = drawable->getVOVolume();
if (volume && volume->isSelected() == selected)
{
for (U32 i = 0; i < volume->getNumTEs(); ++i)
{
LLTextureEntry* te = volume->getTE(i);
textures.insert(te->getID());
}
if (volume->isSculpted())
{
LLUUID sculpt_id = volume->getVolume()->getParams().getSculptID();
if (volume->isMesh())
{
meshes.insert(sculpt_id);
}
else
{
sculpts.insert(sculpt_id);
}
}
}
}
}
gPipeline.mDebugTextureUploadCost = textures.size() * 10;
gPipeline.mDebugSculptUploadCost = sculpts.size()*10;
U32 mesh_cost = 0;
for (std::set<LLUUID>::iterator iter = meshes.begin(); iter != meshes.end(); ++iter)
{
mesh_cost += gMeshRepo.getResourceCost(*iter)*10;
}
gPipeline.mDebugMeshUploadCost = mesh_cost;
}
for (LLCullResult::bridge_list_t::const_iterator i = sCull->beginVisibleBridge(); i != sCull->endVisibleBridge(); ++i)
{
LLSpatialBridge* bridge = *i;

View File

@ -435,6 +435,10 @@ public:
S32 mNumVisibleNodes;
S32 mVerticesRelit;
S32 mDebugTextureUploadCost;
S32 mDebugSculptUploadCost;
S32 mDebugMeshUploadCost;
S32 mLightingChanges;
S32 mGeometryChanges;

View File

@ -43,14 +43,14 @@
function="File.EnableUpload" />
</menu_item_call>
<menu_item_call
label="Model (L$[COST])..."
label="Model..."
layout="topleft"
name="Upload Model">
<menu_item_call.on_click
function="File.UploadModel"
parameter="" />
<menu_item_call.on_enable
function="File.EnableUpload" />
function="File.EnableUploadModel" />
</menu_item_call>
<menu_item_call
label="Scene..."

View File

@ -2061,6 +2061,17 @@
function="ToggleControl"
parameter="DebugShowTime" />
</menu_item_check>
<menu_item_check
label="Show Upload Cost"
layout="topleft"
name="Show Upload Cost">
<menu_item_check.on_check
function="CheckControl"
parameter="DebugShowUploadCost" />
<menu_item_check.on_click
function="ToggleControl"
parameter="DebugShowUploadCost" />
</menu_item_check>
<menu_item_check
label="Show Render Info"
layout="topleft"

View File

@ -80,14 +80,14 @@
function="File.EnableUpload" />
</menu_item_call>
<menu_item_call
label="Model (L$[COST])..."
label="Model..."
layout="topleft"
name="Upload Model">
<menu_item_call.on_click
function="File.UploadModel"
parameter="" />
<menu_item_call.on_enable
function="File.EnableUpload" />
function="File.EnableUploadModel" />
</menu_item_call>
<menu_item_call
label="Scene..."