mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-06 05:13:24 +02:00
Adding support for hifi_global light intensity & COlor and use it to adjust the lighmap parameters
This commit is contained in:
parent
e9add29af1
commit
d4566bb1d7
3 changed files with 9 additions and 3 deletions
|
@ -1219,7 +1219,7 @@ int matchTextureUVSetToAttributeChannel(const QString& texUVSetName, const QHash
|
||||||
|
|
||||||
FBXLight extractLight(const FBXNode& object) {
|
FBXLight extractLight(const FBXNode& object) {
|
||||||
FBXLight light;
|
FBXLight light;
|
||||||
|
int unkwnon = 0;
|
||||||
foreach (const FBXNode& subobject, object.children) {
|
foreach (const FBXNode& subobject, object.children) {
|
||||||
QString childname = QString(subobject.name);
|
QString childname = QString(subobject.name);
|
||||||
if (subobject.name == "Properties70") {
|
if (subobject.name == "Properties70") {
|
||||||
|
@ -1230,6 +1230,8 @@ FBXLight extractLight(const FBXNode& object) {
|
||||||
QString propname = property.properties.at(0).toString();
|
QString propname = property.properties.at(0).toString();
|
||||||
if (propname == "Intensity") {
|
if (propname == "Intensity") {
|
||||||
light.intensity = 0.01f * property.properties.at(valIndex).value<double>();
|
light.intensity = 0.01f * property.properties.at(valIndex).value<double>();
|
||||||
|
} else if (propname == "Color") {
|
||||||
|
light.color = getVec3(property.properties, valIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1817,6 +1819,7 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping,
|
||||||
if (lightmapLevel <= 0.0f) {
|
if (lightmapLevel <= 0.0f) {
|
||||||
loadLightmaps = false;
|
loadLightmaps = false;
|
||||||
}
|
}
|
||||||
|
lightmapOffset = glm::clamp((*lit).second.color.x, 0.f, 1.f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2127,6 +2130,7 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping,
|
||||||
glm::vec2 emissiveParams(0.f, 1.f);
|
glm::vec2 emissiveParams(0.f, 1.f);
|
||||||
emissiveParams.x = lightmapOffset;
|
emissiveParams.x = lightmapOffset;
|
||||||
emissiveParams.y = lightmapLevel;
|
emissiveParams.y = lightmapLevel;
|
||||||
|
|
||||||
QString emissiveTextureID = emissiveTextures.value(childID);
|
QString emissiveTextureID = emissiveTextures.value(childID);
|
||||||
QString ambientTextureID = ambientTextures.value(childID);
|
QString ambientTextureID = ambientTextures.value(childID);
|
||||||
if (loadLightmaps && (!emissiveTextureID.isNull() || !ambientTextureID.isNull())) {
|
if (loadLightmaps && (!emissiveTextureID.isNull() || !ambientTextureID.isNull())) {
|
||||||
|
|
|
@ -179,12 +179,14 @@ public:
|
||||||
QString name;
|
QString name;
|
||||||
Transform transform;
|
Transform transform;
|
||||||
float intensity;
|
float intensity;
|
||||||
|
float fogValue;
|
||||||
glm::vec3 color;
|
glm::vec3 color;
|
||||||
|
|
||||||
FBXLight() :
|
FBXLight() :
|
||||||
name(),
|
name(),
|
||||||
transform(),
|
transform(),
|
||||||
intensity(1.0f),
|
intensity(1.0f),
|
||||||
|
fogValue(0.0f),
|
||||||
color(1.0f)
|
color(1.0f)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,9 +26,9 @@ public:
|
||||||
Pixels(const Element& format, Size size, const Byte* bytes);
|
Pixels(const Element& format, Size size, const Byte* bytes);
|
||||||
~Pixels();
|
~Pixels();
|
||||||
|
|
||||||
mutable Sysmem _sysmem;
|
Sysmem _sysmem;
|
||||||
Element _format;
|
Element _format;
|
||||||
mutable bool _isGPULoaded;
|
bool _isGPULoaded;
|
||||||
};
|
};
|
||||||
typedef QSharedPointer< Pixels > PixelsPointer;
|
typedef QSharedPointer< Pixels > PixelsPointer;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue