summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterstinson.cpp79
1 files changed, 68 insertions, 11 deletions
diff --git a/indra/newview/llfloaterstinson.cpp b/indra/newview/llfloaterstinson.cpp
index 3129a94178..697f110821 100644
--- a/indra/newview/llfloaterstinson.cpp
+++ b/indra/newview/llfloaterstinson.cpp
@@ -50,13 +50,22 @@
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
#include "v4color.h"
+#include "v4coloru.h"
-#define MATERIALS_CAPABILITY_NAME "RenderMaterials"
+#define MATERIALS_CAPABILITY_NAME "RenderMaterials"
-#define MATERIALS_CAP_FULL_PER_FACE_FIELD "FullMaterialsPerFace"
-#define MATERIALS_CAP_FACE_FIELD "Face"
-#define MATERIALS_CAP_MATERIAL_FIELD "Material"
-#define MATERIALS_CAP_OBJECT_ID_FIELD "ID"
+#define MATERIALS_CAP_FULL_PER_FACE_FIELD "FullMaterialsPerFace"
+#define MATERIALS_CAP_FACE_FIELD "Face"
+#define MATERIALS_CAP_MATERIAL_FIELD "Material"
+#define MATERIALS_CAP_OBJECT_ID_FIELD "ID"
+
+#define MATERIALS_CAP_NORMAL_MAP_FIELD "NormMap"
+#define MATERIALS_CAP_SPECULAR_MAP_FIELD "SpecMap"
+#define MATERIALS_CAP_SPECULAR_COLOR_FIELD "SpecColor"
+#define MATERIALS_CAP_SPECULAR_EXP_FIELD "SpecExp"
+#define MATERIALS_CAP_ENV_INTENSITY_FIELD "EnvIntensity"
+#define MATERIALS_CAP_ALPHA_MASK_CUTOFF_FIELD "AlphaMaskCutoff"
+#define MATERIALS_CAP_DIFFUSE_ALPHA_IS_MASK_FIELD "DiffAlphaIsMask"
class MaterialsGetResponder : public LLHTTPClient::Responder
{
@@ -336,19 +345,67 @@ void LLFloaterStinson::requestPutMaterials()
LLSD facesData = LLSD::emptyArray();
+
LLObjectSelectionHandle selectionHandle = LLSelectMgr::getInstance()->getEditSelection();
for (LLObjectSelection::valid_iterator objectIter = selectionHandle->valid_begin();
objectIter != selectionHandle->valid_end(); ++objectIter)
{
LLSelectNode* objectNode = *objectIter;
LLViewerObject* viewerObject = objectNode->getObject();
-
- LLSD faceData = LLSD::emptyMap();
- faceData[MATERIALS_CAP_FACE_FIELD] = static_cast<LLSD::Integer>(0);
- faceData[MATERIALS_CAP_MATERIAL_FIELD] = static_cast<LLSD::Integer>(0);
- faceData[MATERIALS_CAP_OBJECT_ID_FIELD] = viewerObject->getID();
- facesData.append(faceData);
+ S32 numFaces = viewerObject->getNumFaces();
+ for (S32 curFaceIndex = 0; curFaceIndex < numFaces; ++curFaceIndex)
+ {
+ LLSD materialData = LLSD::emptyMap();
+
+#define FACE_MODULATOR 4
+ if ((curFaceIndex % FACE_MODULATOR) == 0)
+ {
+ materialData[MATERIALS_CAP_NORMAL_MAP_FIELD] = LLUUID("dd88438d-895e-4cc4-3557-f8b6870be6e5"); // Library > Textures > Rock > Rock - Rippling
+ materialData[MATERIALS_CAP_SPECULAR_MAP_FIELD] = LLUUID("c7f1beb3-4c5f-f70e-6d96-7668ff8aea0a"); // Library > Textures > Rock > Rock - Granite
+ LLColor4U specularColor(255, 255, 255, 255);
+ materialData[MATERIALS_CAP_SPECULAR_COLOR_FIELD] = specularColor.getValue();
+ materialData[MATERIALS_CAP_SPECULAR_EXP_FIELD] = static_cast<LLSD::Integer>(100);
+ materialData[MATERIALS_CAP_ENV_INTENSITY_FIELD] = static_cast<LLSD::Integer>(25);
+ materialData[MATERIALS_CAP_ALPHA_MASK_CUTOFF_FIELD] = static_cast<LLSD::Integer>(37);
+ materialData[MATERIALS_CAP_DIFFUSE_ALPHA_IS_MASK_FIELD] = static_cast<LLSD::Boolean>(false);
+ }
+ else if ((curFaceIndex % FACE_MODULATOR) == 1)
+ {
+ materialData[MATERIALS_CAP_NORMAL_MAP_FIELD] = LLUUID("cfcd9d0b-f04b-f01a-8b29-519e27078896"); // Library > Textures > Terrain Textures > Terrain Textures - Winter > Primitive Island - Base Ice-rock
+ materialData[MATERIALS_CAP_SPECULAR_MAP_FIELD] = LLUUID("fcad96ba-3495-d426-9713-21cf721332a4"); // Library > Textures > Terrain Textures > Terrain Textures - Winter > Primitive Island - Ice-rock
+ LLColor4U specularColor(100, 50, 200, 128);
+ materialData[MATERIALS_CAP_SPECULAR_COLOR_FIELD] = specularColor.getValue();
+ materialData[MATERIALS_CAP_SPECULAR_EXP_FIELD] = static_cast<LLSD::Integer>(255);
+ materialData[MATERIALS_CAP_ENV_INTENSITY_FIELD] = static_cast<LLSD::Integer>(0);
+ materialData[MATERIALS_CAP_ALPHA_MASK_CUTOFF_FIELD] = static_cast<LLSD::Integer>(5);
+ materialData[MATERIALS_CAP_DIFFUSE_ALPHA_IS_MASK_FIELD] = static_cast<LLSD::Boolean>(true);
+ }
+ else if ((curFaceIndex % FACE_MODULATOR) == 2)
+ {
+ materialData[MATERIALS_CAP_NORMAL_MAP_FIELD] = LLUUID("6ed3abd3-527a-856d-3771-2a04ea4c16e1"); // Library > Textures > Waterfalls > Water - ripple layer 1
+ materialData[MATERIALS_CAP_SPECULAR_MAP_FIELD] = LLUUID("e7c01539-4836-cd47-94ac-55af7502e4db"); // Library > Textures > Waterfalls > Water - ripple layer 2
+ LLColor4U specularColor(128, 128, 128, 255);
+ materialData[MATERIALS_CAP_SPECULAR_COLOR_FIELD] = specularColor.getValue();
+ materialData[MATERIALS_CAP_SPECULAR_EXP_FIELD] = static_cast<LLSD::Integer>(1);
+ materialData[MATERIALS_CAP_ENV_INTENSITY_FIELD] = static_cast<LLSD::Integer>(255);
+ materialData[MATERIALS_CAP_ALPHA_MASK_CUTOFF_FIELD] = static_cast<LLSD::Integer>(75);
+ materialData[MATERIALS_CAP_DIFFUSE_ALPHA_IS_MASK_FIELD] = static_cast<LLSD::Boolean>(false);
+ }
+ else if ((curFaceIndex % FACE_MODULATOR) == 3)
+ {
+ // do nothing
+ }
+
+ if ((curFaceIndex % FACE_MODULATOR) != 3)
+ {
+ LLSD faceData = LLSD::emptyMap();
+ faceData[MATERIALS_CAP_FACE_FIELD] = static_cast<LLSD::Integer>(curFaceIndex);
+ faceData[MATERIALS_CAP_OBJECT_ID_FIELD] = static_cast<LLSD::Integer>(viewerObject->getLocalID());
+ faceData[MATERIALS_CAP_MATERIAL_FIELD] = materialData;
+ facesData.append(faceData);
+ }
+ }
}
LLSD putData = LLSD::emptyMap();