Core implementation of Physical Based Rendering.

This commit is contained in:
Areloch 2018-09-15 20:19:57 -05:00
parent 54f1d8c18e
commit b4a1d18f42
148 changed files with 4464 additions and 1016 deletions

View file

@ -297,6 +297,7 @@ void GBitmap::allocateBitmap(const U32 in_width, const U32 in_height, const bool
case GFXFormatR8G8B8X8:
case GFXFormatR8G8B8A8: mBytesPerPixel = 4;
break;
case GFXFormatL16:
case GFXFormatR5G6B5:
case GFXFormatR5G5B5A1: mBytesPerPixel = 2;
break;
@ -371,6 +372,7 @@ void GBitmap::allocateBitmapWithMips(const U32 in_width, const U32 in_height, co
case GFXFormatR8G8B8X8:
case GFXFormatR8G8B8A8: mBytesPerPixel = 4;
break;
case GFXFormatL16:
case GFXFormatR5G6B5:
case GFXFormatR5G5B5A1: mBytesPerPixel = 2;
break;
@ -679,6 +681,7 @@ bool GBitmap::checkForTransparency()
{
// Non-transparent formats
case GFXFormatL8:
case GFXFormatL16:
case GFXFormatR8G8B8:
case GFXFormatR5G6B5:
break;
@ -754,7 +757,8 @@ bool GBitmap::getColor(const U32 x, const U32 y, ColorI& rColor) const
case GFXFormatL8:
rColor.set( *pLoc, *pLoc, *pLoc, *pLoc );
break;
case GFXFormatL16:
rColor.set(U8(U16((pLoc[0] << 8) + pLoc[2])), 0, 0, 0);
case GFXFormatR8G8B8:
case GFXFormatR8G8B8X8:
rColor.set( pLoc[0], pLoc[1], pLoc[2], 255 );
@ -803,6 +807,10 @@ bool GBitmap::setColor(const U32 x, const U32 y, const ColorI& rColor)
*pLoc = rColor.alpha;
break;
case GFXFormatL16:
dMemcpy(pLoc, &rColor, 2 * sizeof(U8));
break;
case GFXFormatR8G8B8:
dMemcpy( pLoc, &rColor, 3 * sizeof( U8 ) );
break;
@ -1122,6 +1130,7 @@ bool GBitmap::read(Stream& io_rStream)
break;
case GFXFormatR8G8B8A8: mBytesPerPixel = 4;
break;
case GFXFormatL16:
case GFXFormatR5G6B5:
case GFXFormatR5G5B5A1: mBytesPerPixel = 2;
break;