update to Filament libs with inverse bind matrices

This commit is contained in:
Nick Fisher
2022-12-19 10:46:21 +08:00
parent edc95ae628
commit 87e4935864
44 changed files with 516 additions and 84 deletions

View File

@@ -398,6 +398,18 @@ enum class CompressedPixelDataType : uint16_t {
SRGB8_ALPHA8_ASTC_10x10,
SRGB8_ALPHA8_ASTC_12x10,
SRGB8_ALPHA8_ASTC_12x12,
// RGTC formats available with a GLES extension
RED_RGTC1, // BC4 unsigned
SIGNED_RED_RGTC1, // BC4 signed
RED_GREEN_RGTC2, // BC5 unsigned
SIGNED_RED_GREEN_RGTC2, // BC5 signed
// BPTC formats available with a GLES extension
RGB_BPTC_SIGNED_FLOAT, // BC6H signed
RGB_BPTC_UNSIGNED_FLOAT,// BC6H unsigned
RGBA_BPTC_UNORM, // BC7
SRGB_ALPHA_BPTC_UNORM, // BC7 sRGB
};
/** Supported texel formats
@@ -552,6 +564,18 @@ enum class TextureFormat : uint16_t {
SRGB8_ALPHA8_ASTC_10x10,
SRGB8_ALPHA8_ASTC_12x10,
SRGB8_ALPHA8_ASTC_12x12,
// RGTC formats available with a GLES extension
RED_RGTC1, // BC4 unsigned
SIGNED_RED_RGTC1, // BC4 signed
RED_GREEN_RGTC2, // BC5 unsigned
SIGNED_RED_GREEN_RGTC2, // BC5 signed
// BPTC formats available with a GLES extension
RGB_BPTC_SIGNED_FLOAT, // BC6H signed
RGB_BPTC_UNSIGNED_FLOAT,// BC6H unsigned
RGBA_BPTC_UNORM, // BC7
SRGB_ALPHA_BPTC_UNORM, // BC7 sRGB
};
//! Bitmask describing the intended Texture Usage
@@ -632,7 +656,7 @@ static constexpr bool isSignedIntFormat(TextureFormat format) {
}
}
//! returns whether this format a compressed format
//! returns whether this format is a compressed format
static constexpr bool isCompressedFormat(TextureFormat format) noexcept {
return format >= TextureFormat::EAC_R11;
}
@@ -642,7 +666,7 @@ static constexpr bool isETC2Compression(TextureFormat format) noexcept {
return format >= TextureFormat::EAC_R11 && format <= TextureFormat::ETC2_EAC_SRGBA8;
}
//! returns whether this format is an ETC3 compressed format
//! returns whether this format is an S3TC compressed format
static constexpr bool isS3TCCompression(TextureFormat format) noexcept {
return format >= TextureFormat::DXT1_RGB && format <= TextureFormat::DXT5_SRGBA;
}
@@ -651,6 +675,16 @@ static constexpr bool isS3TCSRGBCompression(TextureFormat format) noexcept {
return format >= TextureFormat::DXT1_SRGB && format <= TextureFormat::DXT5_SRGBA;
}
//! returns whether this format is an RGTC compressed format
static constexpr bool isRGTCCompression(TextureFormat format) noexcept {
return format >= TextureFormat::RED_RGTC1 && format <= TextureFormat::SIGNED_RED_GREEN_RGTC2;
}
//! returns whether this format is an BPTC compressed format
static constexpr bool isBPTCCompression(TextureFormat format) noexcept {
return format >= TextureFormat::RGB_BPTC_SIGNED_FLOAT && format <= TextureFormat::SRGB_ALPHA_BPTC_UNORM;
}
static constexpr bool isASTCCompression(TextureFormat format) noexcept {
return format >= TextureFormat::RGBA_ASTC_4x4 && format <= TextureFormat::SRGB8_ALPHA8_ASTC_12x12;
}

View File

@@ -40,33 +40,33 @@ using sRGBColorA = math::float4;
//! types of RGB colors
enum class RgbType : uint8_t {
sRGB, //!< the color is defined in sRGB space
LINEAR, //!< the color is defined in linear space
sRGB, //!< the color is defined in Rec.709-sRGB-D65 (sRGB) space
LINEAR, //!< the color is defined in Rec.709-Linear-D65 ("linear sRGB") space
};
//! types of RGBA colors
enum class RgbaType : uint8_t {
/**
* the color is defined in sRGB space and the RGB values
* have not been premultiplied by the alpha (for instance, a 50%
* the color is defined in Rec.709-sRGB-D65 (sRGB) space and the RGB values
* have not been pre-multiplied by the alpha (for instance, a 50%
* transparent red is <1,0,0,0.5>)
*/
sRGB,
/**
* the color is defined in linear space and the RGB values
* have not been premultiplied by the alpha (for instance, a 50%
* the color is defined in Rec.709-Linear-D65 ("linear sRGB") space and the
* RGB values have not been pre-multiplied by the alpha (for instance, a 50%
* transparent red is <1,0,0,0.5>)
*/
LINEAR,
/**
* the color is defined in sRGB space and the RGB values
* have been premultiplied by the alpha (for instance, a 50%
* the color is defined in Rec.709-sRGB-D65 (sRGB) space and the RGB values
* have been pre-multiplied by the alpha (for instance, a 50%
* transparent red is <0.5,0,0,0.5>)
*/
PREMULTIPLIED_sRGB,
/**
* the color is defined in linear space and the RGB values
* have been premultiplied by the alpha (for instance, a 50%
* the color is defined in Rec.709-Linear-D65 ("linear sRGB") space and the
* RGB values have been pre-multiplied by the alpha (for instance, a 50%
* transparent red is <0.5,0,0,0.5>)
*/
PREMULTIPLIED_LINEAR
@@ -93,40 +93,44 @@ public:
template<ColorConversion = ACCURATE>
static LinearColor toLinear(sRGBColor const& color);
//! converts an RGB color in linear space to an RGB color in sRGB space
/**
* Converts an RGB color in Rec.709-Linear-D65 ("linear sRGB") space to an
* RGB color in Rec.709-sRGB-D65 (sRGB) space.
*/
template<ColorConversion = ACCURATE>
static sRGBColor toSRGB(LinearColor const& color);
/**
* converts an RGBA color in sRGB space to an RGBA color in linear space
* the alpha component is left unmodified
* Converts an RGBA color in Rec.709-sRGB-D65 (sRGB) space to an RGBA color in
* Rec.709-Linear-D65 ("linear sRGB") space the alpha component is left unmodified.
*/
template<ColorConversion = ACCURATE>
static LinearColorA toLinear(sRGBColorA const& color);
/**
* converts an RGBA color in linear space to an RGBA color in sRGB space
* the alpha component is left unmodified
* Converts an RGBA color in Rec.709-Linear-D65 ("linear sRGB") space to
* an RGBA color in Rec.709-sRGB-D65 (sRGB) space the alpha component is
* left unmodified.
*/
template<ColorConversion = ACCURATE>
static sRGBColorA toSRGB(LinearColorA const& color);
/**
* converts a correlated color temperature to a linear RGB color in sRGB
* Converts a correlated color temperature to a linear RGB color in sRGB
* space the temperature must be expressed in kelvin and must be in the
* range 1,000K to 15,000K
* range 1,000K to 15,000K.
*/
static LinearColor cct(float K);
/**
* converts a CIE standard illuminant series D to a linear RGB color in
* Converts a CIE standard illuminant series D to a linear RGB color in
* sRGB space the temperature must be expressed in kelvin and must be in
* the range 4,000K to 25,000K
*/
static LinearColor illuminantD(float K);
/**
* computes the Beer-Lambert absorption coefficients from the specified
* Computes the Beer-Lambert absorption coefficients from the specified
* transmittance color and distance. The computed absorption will guarantee
* the white light will become the specified color at the specified distance.
* The output of this function can be used as the absorption parameter of

View File

@@ -31,6 +31,10 @@ namespace filament {
class Engine;
class FColorGrading;
namespace color {
class ColorSpace;
}
/**
* ColorGrading is used to transform (either to modify or correct) the colors of the HDR buffer
* rendered by Filament. Color grading transforms are applied after lighting, and after any lens
@@ -97,6 +101,7 @@ class FColorGrading;
* - Tone mapping: ACESLegacyToneMapper
* - Luminance scaling: false
* - Gamut mapping: false
* - Output color space: Rec709-sRGB-D65
*
* @see View
*/
@@ -447,6 +452,19 @@ public:
*/
Builder& curves(math::float3 shadowGamma, math::float3 midPoint, math::float3 highlightScale) noexcept;
/**
* Sets the output color space for this ColorGrading object. After all color grading steps
* have been applied, the final color will be converted in the desired color space.
*
* NOTE: Currently the output color space must be one of Rec709-sRGB-D65 or
* Rec709-Linear-D65. Only the transfer function is taken into account.
*
* @param colorSpace The output color space.
*
* @return This Builder, for chaining calls
*/
Builder& outputColorSpace(const color::ColorSpace& colorSpace) noexcept;
/**
* Creates the ColorGrading object and returns a pointer to it.
*

View File

@@ -0,0 +1,256 @@
/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef TNT_FILAMENT_COLOR_SPACE_H
#define TNT_FILAMENT_COLOR_SPACE_H
#include <math/vec2.h>
#include <math/vec3.h>
namespace filament {
namespace color {
using namespace math;
/**
* Holds the chromaticities of a color space's primaries as xy coordinates
* in xyY (Y is assumed to be 1).
*/
struct Primaries {
float2 r;
float2 g;
float2 b;
bool operator==(const Primaries& rhs) const noexcept {
return r == rhs.r && b == rhs.b && g == rhs.b;
}
};
//! Reference white for a color space, defined as the xy coordinates in the xyY space.
using WhitePoint = float2;
/**
* <p>Defines the parameters for the ICC parametric curve type 4, as
* defined in ICC.1:2004-10, section 10.15.</p>
*
* <p>The EOTF is of the form:</p>
*
* \(\begin{equation}
* Y = \begin{cases}c X + f & X \lt d \\\
* \left( a X + b \right) ^{g} + e & X \ge d \end{cases}
* \end{equation}\)
*
* <p>The corresponding OETF is simply the inverse function.</p>
*
* <p>The parameters defined by this class form a valid transfer
* function only if all the following conditions are met:</p>
* <ul>
* <li>No parameter is a NaN</li>
* <li>\(d\) is in the range \([0..1]\)</li>
* <li>The function is not constant</li>
* <li>The function is positive and increasing</li>
* </ul>
*/
struct TransferFunction {
/**
* <p>Defines the parameters for the ICC parametric curve type 3, as
* defined in ICC.1:2004-10, section 10.15.</p>
*
* <p>The EOTF is of the form:</p>
*
* \(\begin{equation}
* Y = \begin{cases}c X & X \lt d \\\
* \left( a X + b \right) ^{g} & X \ge d \end{cases}
* \end{equation}\)
*
* <p>This constructor is equivalent to setting \(e\) and \(f\) to 0.</p>
*
* @param a The value of \(a\) in the equation of the EOTF described above
* @param b The value of \(b\) in the equation of the EOTF described above
* @param c The value of \(c\) in the equation of the EOTF described above
* @param d The value of \(d\) in the equation of the EOTF described above
* @param g The value of \(g\) in the equation of the EOTF described above
*/
constexpr TransferFunction(
double a,
double b,
double c,
double d,
double e,
double f,
double g
) : a(a),
b(b),
c(c),
d(d),
e(e),
f(f),
g(g) {
}
constexpr TransferFunction(
double a,
double b,
double c,
double d,
double g
) : TransferFunction(a, b, c, d, 0.0, 0.0, g) {
}
bool operator==(const TransferFunction& rhs) const noexcept {
return
a == rhs.a &&
b == rhs.b &&
c == rhs.c &&
d == rhs.d &&
e == rhs.e &&
f == rhs.f &&
g == rhs.g;
}
double a;
double b;
double c;
double d;
double e;
double f;
double g;
};
/**
* <p>A color space in Filament is always an RGB color space. A specific RGB color space
* is defined by the following properties:</p>
* <ul>
* <li>Three chromaticities of the red, green and blue primaries, which
* define the gamut of the color space.</li>
* <li>A white point chromaticity that defines the stimulus to which
* color space values are normalized (also just called "white").</li>
* <li>An opto-electronic transfer function, also called opto-electronic
* conversion function or often, and approximately, gamma function.</li>
* <li>An electro-optical transfer function, also called electo-optical
* conversion function or often, and approximately, gamma function.</li>
* </ul>
*
* <h3>Primaries and white point chromaticities</h3>
* <p>In this implementation, the chromaticity of the primaries and the white
* point of an RGB color space is defined in the CIE xyY color space. This
* color space separates the chromaticity of a color, the x and y components,
* and its luminance, the Y component. Since the primaries and the white
* point have full brightness, the Y component is assumed to be 1 and only
* the x and y components are needed to encode them.</p>
*
* <h3>Transfer functions</h3>
* <p>A transfer function is a color component conversion function, defined as
* a single variable, monotonic mathematical function. It is applied to each
* individual component of a color. They are used to perform the mapping
* between linear tristimulus values and non-linear electronic signal value.</p>
* <p>The <em>opto-electronic transfer function</em> (OETF or OECF) encodes
* tristimulus values in a scene to a non-linear electronic signal value.</p>
*/
class ColorSpace {
public:
constexpr ColorSpace(
const Primaries primaries,
const TransferFunction transferFunction,
const WhitePoint whitePoint
) : mPrimaries(primaries),
mTransferFunction(transferFunction),
mWhitePoint(whitePoint) {
}
bool operator==(const ColorSpace& rhs) const noexcept {
return mPrimaries == rhs.mPrimaries &&
mTransferFunction == rhs.mTransferFunction &&
mWhitePoint == rhs.mWhitePoint;
}
constexpr const Primaries& getPrimaries() const { return mPrimaries; }
constexpr const TransferFunction& getTransferFunction() const { return mTransferFunction; }
constexpr const WhitePoint& getWhitePoint() const { return mWhitePoint; }
private:
Primaries mPrimaries;
TransferFunction mTransferFunction;
WhitePoint mWhitePoint;
};
/**
* Intermediate class used when building a color space using the "-" syntax:
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* // Declares a "linear sRGB" color space.
* ColorSpace myColorSpace = Rec709-Linear-sRGB;
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
class PartialColorSpace {
public:
constexpr ColorSpace operator-(const WhitePoint whitePoint) const {
return ColorSpace(mPrimaries, mTransferFunction, whitePoint);
}
private:
constexpr PartialColorSpace(
const Primaries primaries,
const TransferFunction transferFunction
) : mPrimaries(primaries),
mTransferFunction(transferFunction) {
}
Primaries mPrimaries;
TransferFunction mTransferFunction;
friend class Gamut;
};
/**
* Defines the chromaticities of the primaries for a color space. The chromaticities
* are expressed as three pairs of xy coordinates (in xyY) for the red, green, and blue
* chromaticities.
*/
class Gamut {
public:
constexpr Gamut(const Primaries primaries) : mPrimaries(primaries) {
}
constexpr Gamut(float2 r, float2 g, float2 b) : Gamut(Primaries{r, g, b}) {
}
constexpr PartialColorSpace operator-(const TransferFunction transferFunction) const {
return PartialColorSpace(mPrimaries, transferFunction);
}
constexpr const Primaries& getPrimaries() const { return mPrimaries; }
private:
Primaries mPrimaries;
};
//! Rec.709 color gamut, used in the sRGB and DisplayP3 color spaces.
constexpr Gamut Rec709 = Gamut({0.640f, 0.330f}, {0.300f, 0.600f}, {0.150f, 0.060f});
//! Linear transfer function.
constexpr TransferFunction Linear = TransferFunction(1.0, 0.0, 0.0, 0.0, 1.0);
//! sRGB transfer function.
constexpr TransferFunction sRGB =
TransferFunction(1.0 / 1.055, 0.055 / 1.055, 1.0 / 12.92, 0.04045, 2.4);
//! Standard CIE 1931 2° illuminant D65. This illuminant has a color temperature of 6504K.
constexpr WhitePoint D65 = WhitePoint({0.31271f, 0.32902f});
} // namespace color
} // namespace filament
#endif // TNT_FILAMENT_COLOR_SPACE_H

View File

@@ -340,14 +340,6 @@ public:
* @see View::setShadowType
*/
struct Vsm {
/**
* The number of MSAA samples to use when rendering VSM shadow maps.
* Must be a power-of-two and greater than or equal to 1. A value of 1 effectively turns
* off MSAA.
* Higher values may not be available depending on the underlying hardware.
*/
uint8_t msaaSamples = 1;
/**
* When elvsm is set to true, "Exponential Layered VSM without Layers" are used. It is
* an improvement to the default EVSM which suffers important light leaks. Enabling

View File

@@ -27,7 +27,7 @@
namespace filament {
// update this when a new version of filament wouldn't work with older materials
static constexpr size_t MATERIAL_VERSION = 28;
static constexpr size_t MATERIAL_VERSION = 31;
/**
* Supported shading models

View File

@@ -277,6 +277,12 @@ public:
*/
void setMaskThreshold(float threshold) noexcept;
/**
* Gets the minimum alpha value a fragment must have to not be discarded when the blend
* mode is MASKED
*/
float getMaskThreshold() const noexcept;
/**
* Sets the screen space variance of the filter kernel used when applying specular
* anti-aliasing. The default value is set to 0.15. The specified value should be between
@@ -284,6 +290,12 @@ public:
*/
void setSpecularAntiAliasingVariance(float variance) noexcept;
/**
* Gets the screen space variance of the filter kernel used when applying specular
* anti-aliasing.
*/
float getSpecularAntiAliasingVariance() const noexcept;
/**
* Sets the clamping threshold used to suppress estimation errors when applying specular
* anti-aliasing. The default value is set to 0.2. The specified value should be between 0
@@ -291,6 +303,12 @@ public:
*/
void setSpecularAntiAliasingThreshold(float threshold) noexcept;
/**
* Gets the clamping threshold used to suppress estimation errors when applying specular
* anti-aliasing.
*/
float getSpecularAntiAliasingThreshold() const noexcept;
/**
* Enables or disables double-sided lighting if the parent Material has double-sided capability,
* otherwise prints a warning. If double-sided lighting is enabled, backface culling is
@@ -298,36 +316,72 @@ public:
*/
void setDoubleSided(bool doubleSided) noexcept;
/**
* Returns whether double-sided lighting is enabled when the parent Material has double-sided
* capability.
*/
bool isDoubleSided() const noexcept;
/**
* Specifies how transparent objects should be rendered (default is DEFAULT).
*/
void setTransparencyMode(TransparencyMode mode) noexcept;
/**
* Returns the transparency mode.
*/
TransparencyMode getTransparencyMode() const noexcept;
/**
* Overrides the default triangle culling state that was set on the material.
*/
void setCullingMode(CullingMode culling) noexcept;
/**
* Returns the face culling mode.
*/
CullingMode getCullingMode() const noexcept;
/**
* Overrides the default color-buffer write state that was set on the material.
*/
void setColorWrite(bool enable) noexcept;
/**
* Returns whether color write is enabled.
*/
bool isColorWriteEnabled() const noexcept;
/**
* Overrides the default depth-buffer write state that was set on the material.
*/
void setDepthWrite(bool enable) noexcept;
/**
* Returns whether depth write is enabled.
*/
bool isDepthWriteEnabled() const noexcept;
/**
* Overrides the default depth testing state that was set on the material.
*/
void setDepthCulling(bool enable) noexcept;
/**
* Returns whether depth culling is enabled.
*/
bool isDepthCullingEnabled() const noexcept;
/**
* Overrides the default stencil-buffer write state that was set on the material.
*/
void setStencilWrite(bool enable) noexcept;
/**
* Returns whether stencil write is enabled.
*/
bool isStencilWriteEnabled() const noexcept;
/**
* Sets the stencil comparison function (default is StencilCompareFunc::A).
*

View File

@@ -390,6 +390,14 @@ struct VsmShadowOptions {
*/
bool mipmapping = false;
/**
* The number of MSAA samples to use when rendering VSM shadow maps.
* Must be a power-of-two and greater than or equal to 1. A value of 1 effectively turns
* off MSAA.
* Higher values may not be available depending on the underlying hardware.
*/
uint8_t msaaSamples = 1;
/**
* Whether to use a 32-bits or 16-bits texture format for VSM shadow maps. 32-bits
* precision is rarely needed, but it does reduces light leaks as well as "fading"

View File

@@ -117,15 +117,37 @@ public:
* ClearOptions are used at the beginning of a frame to clear or retain the SwapChain content.
*/
struct ClearOptions {
/** Color to use to clear the SwapChain */
/**
* Color (sRGB linear) to use to clear the RenderTarget (typically the SwapChain).
*
* The RenderTarget is cleared using this color, which won't be tone-mapped since
* tone-mapping is part of View rendering (this is not).
*
* When a View is rendered, there are 3 scenarios to consider:
* - Pixels rendered by the View replace the clear color (or blend with it in
* `BlendMode::TRANSLUCENT` mode).
*
* - With blending mode set to `BlendMode::TRANSLUCENT`, Pixels untouched by the View
* are considered fulling transparent and let the clear color show through.
*
* - With blending mode set to `BlendMode::OPAQUE`, Pixels untouched by the View
* are set to the clear color. However, because it is now used in the context of a View,
* it will go through the post-processing stage, which includes tone-mapping.
*
* For consistency, it is recommended to always use a Skybox to clear an opaque View's
* background, or to use black or fully-transparent (i.e. {0,0,0,0}) as the clear color.
*/
math::float4 clearColor = {};
/** Value to clear the stencil buffer */
uint8_t clearStencil = 0u;
/**
* Whether the SwapChain should be cleared using the clearColor. Use this if translucent
* View will be drawn, for instance.
*/
bool clear = false;
/**
* Whether the SwapChain content should be discarded. clear implies discard. Set this
* to false (along with clear to false as well) if the SwapChain already has content that

View File

@@ -80,14 +80,7 @@ public:
*
* @return The associated Skybox, or nullptr if there is none.
*/
Skybox* getSkybox() noexcept;
/**
* Returns an immutable Skybox associated with the Scene.
*
* @return The associated Skybox, or nullptr if there is none.
*/
Skybox const* getSkybox() const noexcept;
Skybox* getSkybox() const noexcept;
/**
* Set the IndirectLight to use when rendering the Scene.
@@ -96,8 +89,17 @@ public:
* IndirectLight.
*
* @param ibl The IndirectLight to use when rendering the Scene or nullptr to unset.
* @see getIndirectLight
*/
void setIndirectLight(IndirectLight const* ibl) noexcept;
void setIndirectLight(IndirectLight* ibl) noexcept;
/**
* Get the IndirectLight or nullptr if none is set.
*
* @return the the IndirectLight or nullptr if none is set
* @see setIndirectLight
*/
IndirectLight* getIndirectLight() const noexcept;
/**
* Adds an Entity to the Scene.

View File

@@ -126,7 +126,12 @@ public:
*/
void detachSkin(size_t skinIndex, utils::Entity target) noexcept;
const math::mat4f* getInverseBindMatricesAt(size_t skinIndex) const noexcept;
/**
* Gets inverse bind matrices for all joints at the given skin index.
*
* See getJointCountAt for determining the number of matrices returned (i.e. the number of joints).
*/
math::mat4f const* getInverseBindMatricesAt(size_t skinIndex) const;
/**
* Resets the AABB on all renderables by manually computing the bounding box.

View File

@@ -225,6 +225,16 @@ public:
static constexpr uint32_t RGBA_S3TC_DXT3 = 0x83F2;
static constexpr uint32_t RGBA_S3TC_DXT5 = 0x83F3;
static constexpr uint32_t R_RGTC_BC4_UNORM = 0x8DBB;
static constexpr uint32_t R_RGTC_BC4_SNORM = 0x8DBC;
static constexpr uint32_t RG_RGTC_BC5_UNORM = 0x8DBD;
static constexpr uint32_t RG_RGTC_BC5_SNORM = 0x8DBE;
static constexpr uint32_t RGBA_BPTC_BC7 = 0x8E8C;
static constexpr uint32_t SRGB8_ALPHA8_BPTC_BC7 = 0x8E8D;
static constexpr uint32_t RGB_BPTC_BC6H_SNORM = 0x8E8E;
static constexpr uint32_t RGB_BPTC_BC6H_UNORM = 0x8E8F;
static constexpr uint32_t RGBA_ASTC_4x4 = 0x93B0;
static constexpr uint32_t RGBA_ASTC_5x4 = 0x93B1;
static constexpr uint32_t RGBA_ASTC_5x5 = 0x93B2;

View File

@@ -51,7 +51,6 @@ namespace Ktx1Reader {
PixelDataFormat toPixelDataFormat(const KtxInfo& info);
bool isCompressed(const KtxInfo& info);
TextureFormat toTextureFormat(const KtxInfo& info);
TextureFormat toSrgbTextureFormat(TextureFormat tex);
template<typename T>
T toCompressedFilamentEnum(uint32_t format) {
@@ -60,6 +59,14 @@ namespace Ktx1Reader {
case Ktx1Bundle::RGBA_S3TC_DXT1: return T::DXT1_RGBA;
case Ktx1Bundle::RGBA_S3TC_DXT3: return T::DXT3_RGBA;
case Ktx1Bundle::RGBA_S3TC_DXT5: return T::DXT5_RGBA;
case Ktx1Bundle::R_RGTC_BC4_UNORM: return T::RED_RGTC1;
case Ktx1Bundle::R_RGTC_BC4_SNORM: return T::SIGNED_RED_RGTC1;
case Ktx1Bundle::RG_RGTC_BC5_UNORM: return T::RED_GREEN_RGTC2;
case Ktx1Bundle::RG_RGTC_BC5_SNORM: return T::SIGNED_RED_GREEN_RGTC2;
case Ktx1Bundle::RGBA_BPTC_BC7: return T::RGBA_BPTC_UNORM;
case Ktx1Bundle::SRGB8_ALPHA8_BPTC_BC7: return T::SRGB_ALPHA_BPTC_UNORM;
case Ktx1Bundle::RGB_BPTC_BC6H_SNORM: return T::RGB_BPTC_SIGNED_FLOAT;
case Ktx1Bundle::RGB_BPTC_BC6H_UNORM: return T::RGB_BPTC_UNSIGNED_FLOAT;
case Ktx1Bundle::RGBA_ASTC_4x4: return T::RGBA_ASTC_4x4;
case Ktx1Bundle::RGBA_ASTC_5x4: return T::RGBA_ASTC_5x4;
case Ktx1Bundle::RGBA_ASTC_5x5: return T::RGBA_ASTC_5x5;

View File

@@ -588,6 +588,26 @@ constexpr mat4f highPrecisionMultiply(mat4f const& lhs, mat4f const& rhs) noexce
};
}
// mat4 * float4, with double precision intermediates
constexpr double4 highPrecisionMultiplyd(mat4f const& lhs, float4 const& rhs) noexcept {
double4 result{};
result += lhs[0] * rhs[0];
result += lhs[1] * rhs[1];
result += lhs[2] * rhs[2];
result += lhs[3] * rhs[3];
return result;
}
// mat4 * mat4, with double precision intermediates
constexpr mat4 highPrecisionMultiplyd(mat4f const& lhs, mat4f const& rhs) noexcept {
return {
highPrecisionMultiplyd(lhs, rhs[0]),
highPrecisionMultiplyd(lhs, rhs[1]),
highPrecisionMultiplyd(lhs, rhs[2]),
highPrecisionMultiplyd(lhs, rhs[3])
};
}
// ----------------------------------------------------------------------------------------
} // namespace math
} // namespace filament

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ac4abd851be9f0eed4b95000baef7fa2b0409c1df337295cf5e1ef1b7d6dbaea
size 1690468
oid sha256:cb6ba132c548a3bcc2e0c111cae25c074d70120c20b6b289321872564b81e2d9
size 1690912

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f35efb26c0143301cdee46e7362656970520f5f65d4b3c654d18b69e38cb9bc4
oid sha256:21592de4a2b39f161888d53e038a9127d839473c9ace979fb814b48f06a14344
size 537812

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:571e356344c8cad8c87708e92dde7889516b6f6b6b8c92a75fe2d1a53104cb54
oid sha256:1d1d5f46c5f82743ab57c4f3f3b36c5df416e20fa0260ac2ff6a3482a8d55103
size 1135330

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bf814327734358793f6df11c88637b98b9ff9e5bd440a2dce8d9e51071c188dd
oid sha256:39173b95d2d62c86286710d1a750adc763eb8fcd997e7cd727de93db13e78d63
size 175380

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3d56a24728acf4b18a12230984c6657e0f87e7d06196bc5870dc9af7d1f945e1
oid sha256:ffe70b910aebf2abf44b8c81662bfc42c6dd0e4c3444dd187aea93d9fe4cebf0
size 60246

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eb778f2052cdf43e20d4c5c6b0c9caedafaaec1cd67c093a017111bb0370ae6b
oid sha256:5835d4acb013a0ee99c7a1f63bd6b0fded1dd328b1baa9283b80304092ea6d53
size 300552

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:00631ea36f087c1bccdfc9ad093c80b337ca08819358385967ea9138603cd79e
size 64946
oid sha256:01026d0c7d9616ab564929dd01cd5d860ba596d7759453c713d16f6607bbeea5
size 64922

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:007d156c68edfeb1d410094820acef98a5144a75b5858e0aa538af50eec3e59e
oid sha256:1dcb0dfb5719dc907f8d9394a4b8058718f1fe927a54945c9442baee2e513687
size 43616

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0efa5a8a9ec3d114a9882d17e5231f24600250510743d2e25086b7973f945860
size 29448180
oid sha256:6e68768321c4adb6a13ebf391d12fcfc05a4431f3bd7e3c8a713b75c039b114b
size 29449706

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6eb32aae2e7f732b7f22e8c169e795b8e67f67cd2469a158529353d74f56e4d5
size 584682
oid sha256:1a37b086743bf2cfcdc93d61e73b5e0a42f66ca3afb3a62683aa57a67c2a18d8
size 584922

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fc5486db22a0d01f16ef6f093cc737f950a9ed90f7f880651aa88061be4bb1aa
size 52686
oid sha256:5385990255687a934b402f510a63bf3fa8d12b0f88abe8f25be96d83e3eb91ff
size 52654

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f77735120c66966b7dd760510b3ec541cea2116e6098099520028156bec8b6fb
size 2634676
oid sha256:01ba72dbaeaedef96258178c77b8d63cfda5ce30ffa85d7a93410b0e01a8935e
size 2663732

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c16ca38264d0b6e4c08680ee6038b94d7061fb9c19b4078d65ad0c764e717e2e
oid sha256:ec2c3824c2beb6e90c32223a867862a2b70b5b6751d69945859fdafbdb7e6ab6
size 39506

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e865b838a0e09daf6f77dff65aa833fab34d1d74acec95c2f19179e624ed26ef
size 39390
oid sha256:9a594a19eeb3057b9c389dcb382aafff6aeb8d718cf1ba0fbc922e8521dc599b
size 39294

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:04b04d76363603d7500243c2f1c03c84ac564a7207bc07464499ba9dc87d6d17
oid sha256:90b7e4822e1e75e6c18c516e37e9bef14b52b72f488425b3b10d24be68729b64
size 46224

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:84680f658766b77a42775f10a0ad4a28acfbb4f7c42d62532ad22efa1c6b2ccf
size 1127462
oid sha256:10a3362675387d78d91fae9ed1cfa0af45475fd6cb8e73aa36e7328167c8cb9e
size 1129798

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bb24571755f31e2730a42ba68c9f4b5d32ef7cacb007716cd98a08836e4ca1d5
oid sha256:18466a3c25363e7c626e44caeb22b43b048e25fa9b4736c74d406e9becdc931c
size 399434

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:78f779af48d685f2a62286e6677a099ee5901c317cbcb26fe539ced28d71b70b
oid sha256:9f585485ef2658154ec3520590728f109973b147a186429e63cb17e44b921b8f
size 491202

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:28709bdf232b2069ae6e27a88bb0b75efa22de8699978c14bd9b5a99245ad5d7
oid sha256:76ad723b79217e3826c59730016e64d0610d7ec45220bc6822ba13e3539e7d64
size 111950

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:395dda9bc2487e5985eb391473915debc60d9ea922debfca0377abe35f95fe94
size 76350
oid sha256:2669fabee776430cf1105ac6022582a418ad1b9a45a0c23f20983ef98282bee6
size 78742

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4ba2e8232e23c7adee35713a8857329077c16936500decde0750c27dccf6f24d
oid sha256:4deb534adf10025308c446fac4c9b18c695a2539c099a7432123c0b666f4f400
size 7384824

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e71274e730f076b0e0c20e597b1d064bdb454c70b96329d671c386b0b7d27a18
oid sha256:74d6bfa3821165828fde940ffa8c6b0e3b8c62ac52650e0cae890fb321508861
size 169098

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3da1577af7d0a9b5e4fa5bfc266fff94422cec7146e37b9990ceb292de234009
size 124252
oid sha256:f4d4641603da2f50aff72d77f21f9f62ab9b4185b561efc5607f84999743145c
size 125590

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b1b6a3f52c0aab90f57b6065d619886f452e1864c88607eb9cfe05f74e55ebef
oid sha256:3118b9cbe91f3e45c29b9c7f478f20b0ab18cdce2704a90ff3166d4fb456847a
size 142614

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b158a409609feadfb91a629dbff4f004fb04a618d44a4a6a39194e1c8d010831
size 181972
oid sha256:5792ca5675b1f4c5d482703986d9407b0a01d122eac927cbcc7a1fa43d447e37
size 1119012

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9e9a9a9f5f9bf270bc2dbe09b2688e04293d739b6552cc5cdf7cd8489ff71792
oid sha256:6c006ad698ac5118e324aa4e7c6d0ba55bf8af16311b62189c49ea81a049cf2a
size 32808

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:84c732d5da0b9db1ed45a76b5d2759194c39ffab3c05b1accb309bb3da179470
oid sha256:cc631c000292b1e8f75031fdf3c137eee9541be35bbe16376feedeb7b35d8e48
size 309080

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3d118ef6f39b678b054bdaab6a6e0df3334f986c8a7e1f587f80c77f299118d4
size 532758
oid sha256:a9ac560d0e8041ed639b858a6edc0d93f532bd4a28a5083309361f13feccc2bd
size 533142

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a525737650b7f894af676df385eab74ff4774fb6d682cd20d8d814e3c3a5abf0
oid sha256:59b230c2f67fa8f2f05fd9b8e93f9f4246ec061a30b463d7fec0c7d236dceeaf
size 2358

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:df6e739b1345d375242b4c88a35ca0c751a3f26b4a921d7fdd643c99b106bcc5
oid sha256:e1e29baa115344fdef01c39284766157b68455e8ae41989aa6ce640208f16783
size 997970