mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 00:24:40 +00:00
Merge branch 'Preview4_0' of https://github.com/Areloch/Torque3D into Preview4_0
This commit is contained in:
commit
72a5e2eefe
2 changed files with 14 additions and 13 deletions
|
|
@ -1131,6 +1131,13 @@ GFXTextureObject *GFXTextureManager::createCompositeTexture(GBitmap*bmp[4], U32
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GFXTextureObject* cacheHit = _lookupTexture(resourceName, profile);
|
||||||
|
if (cacheHit != NULL)
|
||||||
|
{
|
||||||
|
// Con::errorf("Cached texture '%s'", (resourceName.isNotEmpty() ? resourceName.c_str() : "unknown"));
|
||||||
|
return cacheHit;
|
||||||
|
}
|
||||||
|
|
||||||
U8 rChan, gChan, bChan, aChan;
|
U8 rChan, gChan, bChan, aChan;
|
||||||
GBitmap *outBitmap = new GBitmap();
|
GBitmap *outBitmap = new GBitmap();
|
||||||
outBitmap->allocateBitmap(bmp[0]->getWidth(), bmp[0]->getHeight(),false, GFXFormatR8G8B8A8);
|
outBitmap->allocateBitmap(bmp[0]->getWidth(), bmp[0]->getHeight(),false, GFXFormatR8G8B8A8);
|
||||||
|
|
@ -1160,19 +1167,14 @@ GFXTextureObject *GFXTextureManager::createCompositeTexture(GBitmap*bmp[4], U32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GFXTextureObject *cacheHit = _lookupTexture(resourceName, profile);
|
if (deleteBmp)
|
||||||
if (cacheHit != NULL)
|
|
||||||
{
|
{
|
||||||
// Con::errorf("Cached texture '%s'", (resourceName.isNotEmpty() ? resourceName.c_str() : "unknown"));
|
delete[] bmp;
|
||||||
if (deleteBmp)
|
|
||||||
{
|
|
||||||
delete outBitmap;
|
|
||||||
delete[] bmp;
|
|
||||||
}
|
|
||||||
return cacheHit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return _createTexture(outBitmap, resourceName, profile, deleteBmp, NULL);
|
GFXTextureObject * ret= _createTexture(outBitmap, resourceName, profile, deleteBmp, NULL);
|
||||||
|
delete outBitmap;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
GFXTextureObject* GFXTextureManager::_findPooledTexure( U32 width,
|
GFXTextureObject* GFXTextureManager::_findPooledTexure( U32 width,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
// IN THE SOFTWARE.
|
// IN THE SOFTWARE.
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//#define TORQUE_PBR_MATERIALS
|
#define TORQUE_PBR_MATERIALS
|
||||||
|
|
||||||
#include "platform/platform.h"
|
#include "platform/platform.h"
|
||||||
#include "ts/loader/appSequence.h"
|
#include "ts/loader/appSequence.h"
|
||||||
|
|
@ -190,14 +190,13 @@ void AssimpAppMaterial::initMaterial(const Torque::Path& path, Material* mat) co
|
||||||
if (AI_SUCCESS == mAIMat->Get(AI_MATKEY_TEXTURE(aiTextureType_UNKNOWN, 0), texName))
|
if (AI_SUCCESS == mAIMat->Get(AI_MATKEY_TEXTURE(aiTextureType_UNKNOWN, 0), texName))
|
||||||
rmName = texName.C_Str();
|
rmName = texName.C_Str();
|
||||||
|
|
||||||
mat->mIsSRGb[0] = true;
|
|
||||||
if (aoName.isNotEmpty() || rmName.isNotEmpty())
|
if (aoName.isNotEmpty() || rmName.isNotEmpty())
|
||||||
{ // If we have either map, fill all three slots
|
{ // If we have either map, fill all three slots
|
||||||
if (rmName.isNotEmpty())
|
if (rmName.isNotEmpty())
|
||||||
{
|
{
|
||||||
mat->mRoughMapFilename[0] = cleanTextureName(rmName, cleanFile, path, false); // Roughness
|
mat->mRoughMapFilename[0] = cleanTextureName(rmName, cleanFile, path, false); // Roughness
|
||||||
mat->mSmoothnessChan[0] = 1.0f;
|
mat->mSmoothnessChan[0] = 1.0f;
|
||||||
mat->mInvertSmoothness = (floatVal == 1.0f);
|
mat->mInvertSmoothness[0] = (floatVal == 1.0f);
|
||||||
mat->mMetalMapFilename[0] = cleanTextureName(rmName, cleanFile, path, false); // Metallic
|
mat->mMetalMapFilename[0] = cleanTextureName(rmName, cleanFile, path, false); // Metallic
|
||||||
mat->mMetalChan[0] = 2.0f;
|
mat->mMetalChan[0] = 2.0f;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue